CONTROL SET IMAGE statement

Purpose | Change the icon or bitmap displayed in an IMAGE control. The new image is not re-sized to fit the size of the control.
Syntax | CONTROL SET IMAGE hDlg, id&, newimage$
Remarks | hDlg refers to the dialog that owns the control. id& is the unique control identifier as assigned to the control with the CONTROL ADD IMAGE statement. newimage$ specifies the name of the bitmap or icon in the resource file. If the image resource uses an integral identifier, newimage$ should begin with a Number symbol (#), followed by the integer identifier in ASCII format. For example, "#998". Otherwise, the text identifier name should be used.

Restrictions

Images can only be exchanged with images of the same type. That is, if the control is displaying a bitmap then the replacement image must also be a bitmap. If the control is displaying an icon, the replacement image must also be an icon. For best results, icons should be 32x32 pixels.

When an image is changed, CONTROL SET IMAGE automatically releases the old image from memory. Previous versions of PowerBASIC placed the onus on the programmer to release the old image handle.

See also | Dynamic Dialog Tools, CONTROL ADD GRAPHIC, CONTROL ADD IMAGE, CONTROL ADD IMAGEX, CONTROL ADD IMGBUTTON, CONTROL ADD IMGBUTTONX, CONTROL GET CLIENT, CONTROL GET SIZE, CONTROL SET IMAGEX, CONTROL SET IMGBUTTON, CONTROL SET IMGBUTTONX