setCtlImage
Syntax
setCtlImage(int ctl, string filename, string type)
Arguments
- ctl
- The number of the control whose image you want to change.
- filename
- The filename of the image you want to display.
- type
- The type of the image file you want to display (see below).
Description
setCtlImage changes the image displayed by an IMAGE, METAFILE, BITMAP, or ICON control at run time. The type is a single char constant that specifies the type of image file, as follows:
'B' - bitmap file (.bmp)
'W' - Windows (old-style) metafile (.wmf)
'E' - enhanced metafile (.emf)
'I' - icon file (.ico)
'C' - cursor file (.cur)
'J' - JPEG file (.jpg)
'G' - GIF file (.gif)
'M' - MIG (mouse-ivo graphics) file (.mig)
'0' - unspecified file type
Example
// Sets control number 8 to display the progress5.bmp
// bitmap image, stored in the bitmaps subdirectory.
setCtlImage(8, "bitmaps\\progress5.bmp", 'B');
Comments
- Only the 'B', 'W', 'E', and 'I' file types are recognized in the current release. The remaining types are reserved for future use.
- If you have problems embedding an image in your plugin, check that you have used double backslashes (ie the \ character) in the pathname of the image file, everywhere you use it. Although using forward slashes will work for loading external image files, it will not work for embedded images.
- Also check that the filename you use in setCtlImage is the same one that you embedded. If you use a full pathname when embedding, you must also use the full pathname when calling setCtlImage.
See Also
BITMAP, IMAGE, METAFILE, ICON