DisplayImageFile

int DisplayImageFile (int panelHandle, int controlID, char filename[]);

Purpose

Displays the contents of an image file on a picture control.

This function supports the following image types: .pcx, .bmp, .dib, .rle, .ico, .jpg, .png, .wmf, and .emf.

Linux This function supports the following image types: .pcx, .jpg, and .xwd.

To display an image, first create a picture control in the User Interface Editor or using NewCtrl. Then call DisplayImageFile using the control ID for that picture control.

To replace the current image with another image, call DisplayImageFile with the same control ID but a different image file.

To delete the image, call DeleteImage, which also removes the image from memory.

Parameters

Input
Name Type Description
panelHandle integer Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID integer The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl.
filename string Pathname of the file that contains the image.

You can use a complete pathname or a simple filename. If the name is a simple filename, the file is loaded from the directory that contains the executable.

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx Success