Shiny Language Reference

Language Reference > Image Functions


getimagewidth

int getimagewidth(image ImgVar);

 

Synonyms:

int getimgwidth(image ImgVar);

 

 

Returns the width in pixels of the specified image

GETIMAGEWIDTH returns the width in pixels of an image previously loaded by a call to createimage. If GETIMAGEWIDTH is given an image variable that has not previously been initialized by createimage it will always return -1.

 

Parameters

ImgVar

The variable declared as type IMAGE to return the width of.

 

Return Value

The width in pixels of the image, or -1 if the specified var type IMAGE parameter has not been initialized.

 

Example Code

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

int Width = getimagewidth(MyImage);