getImage

>>--getImage(--+--------+--)---------------------------------------------------><
               +--type--+

Returns the static control's image, if there is one. Only the image type static control will have an image.

Details

Raises syntax errors when incorrect arguments are detected.

Programmers should manage the image objects as they think best. See the .Image documentation for a discussion of this. The static control does not make a copy of the image, nor does it release an image.

Arguments:

The only optional argument is:

type

Specifies the type of the image: bitmap, icon, cursor, or enhanced metafile. You can use .Image~toID() to get the correct numeric value for one of the following symbols:

IMAGE_BITMAPIMAGE_ICON
IMAGE_CURSORIMAGE_ENHMETAFILE

The default is IMAGE_BITMAP.

The programmer does not have to use .Image~toID() to get the numeric value for type. The correct number itself can be used. In general, symbolic IDs are used to make code more readable and less prone to error. However, since the value of IMAGE_CURSOR is 2, for example, the programmer could use 2 directly for the type argument.

Return value:

This method returns the .Image object for the control, if there is one. If no image has been set, then .nil is returned.

Example:

This example ...

::method onExit
  expose staticPicture

  image = staticPicture~getImage(.Image~toID(IMAGE_CURSOR))
  if \ image~isNull then image~release