Shiny Language Reference

Language Reference > Image Functions


createimage

bool createimage(image ImgVar, string Filename);

 

Synonyms:

bool imagecreate(image ImgVar, string Filename);

 

 

Creates an image from a local file

CREATEIMAGE loads the specified image from disk and associates it with the specified IMAGE variable. Filetypes supported are GIF, JPG, PNG, BMP, WMF and EMF formats. Transparent GIFs and per-pixel alphablended PNGs are supported. The return value indicates whether the image was successfully loaded.

 

Parameters

ImgVar

The variable declared as type IMAGE to associate with this image object

Filename

The local path and filename of the image to load. Remember to escape backslashes when specifying a path.

 

Return Value

TRUE if the image was loaded successfully, otherwise FALSE.

 

Example Code

// Loads C:\MyBitmap.bmp into MyImage. Note escaped backslash
image MyImage;
bool Result = createimage(MyImage, "C:\\MyBitmap.bmp");