DlgSetPicture (statement)

Syntax DlgSetPicture {ControlName$ | ControlIndex},PictureName$,PictureType
Description Changes the content of the specified picture or picture button control.
Comments The DlgSetPicture statement accepts the following parameters:
Parameter Description
ControlName$ String containing the name of the .Identifier parameter associated with a control in the dialog box template. A case-insensitive comparison is used to locate the specified control within the template. Alternatively, by specifying the ControlIndex parameter, a control can be referred to using its index in the dialog box template (0 is the first control in the template, 1 is the second, and so on).
PictureName$ String containing the name of the picture. If PictureType is 0, then this parameter specifies the name of the file containing the image. If PictureType is 10, then PictureName$ specifies the name of the image within the resource of the picture library. If PictureName$ is empty, then the current picture associated with the specified control will be deleted. Thus, a technique for conserving memory and resources would involve setting the picture to empty before hiding a picture control.
PictureType Integer specifying the source for the image. The following sources are supported:
0 The image is contained in a file on disk.
10 The image is contained in the picture library specified by the Begin Dialog statement. When this type is used, the PictureName$ parameter must be specified with the Begin Dialog statement.
Example
Sub Main()
  DlgSetPicture "Picture1","\windows\checks.bmp",0 'Set picture from a file.
  DlgSetPicture 27,"FaxReport",10  'Set control 10's image
                         'from a library.
End Sub
See Also DlgEnable (function); DlgEnable (statement); DlgFocus (function); DlgFocus (statement); DlgListBoxArray (function); DlgListBoxArray (statement); DlgText (statement); DlgText$ (function); DlgValue (function); DlgValue (statement); DlgVisible (statement); DlgVisible (function), Picture (statement), PictureButton (statement).
Notes Picture controls can contain either bitmaps or WMFs (Windows metafiles). When extracting images from a picture library, the Basic Control Engine assumes that the resource type for metafiles is 256. Picture libraries are implemented as DLLs on the Windows and Win32 platforms.