PickBMP

(VTScada-Layer function. Must be called with a leading backslash.)

Description:

Displays a"Select Image" dialog box with samples of bitmaps available for selection.

Returns:

Image object

(Selection is returned via a parameter.)

Usage: Script Only.
Function Groups: Graphics
Related to: FileDialogBox
Format:

PickBMP(Invalid, Invalid, Invalid, Left, Top, pFName[, Invalid, Animated, pParms])

Parameters:  
Invalid x 3
The first three parameters are obsolete. Provide Invalid as a placeholder.
Left
Required numeric. The coordinates for the left edge of the dialog box.
Top
Required numeric. The coordinates for the top edge of the dialog box.
pFName

Required pointer. The file name of the selected image will be returned via this parameter.

Returns zero (0) if no valid file name can be returned.

Invalid
Obsolete parameter
Animated
Required Boolean. The dialog can provide animated bitmaps if this parameter is set TRUE.
pParms

Required pointer.

In the case of a selection of animations, this is a pointer to the parameters array of the selected Animated bitmap. These include Image directory, scale, FPS, etc.

In the case of an image, this is set to the image directory path.

Comments:

The selected image can be drawn using either \Bitmap or \AnimatedBitmap.

Example:

  If WinButton(100,100,140,120,
               0, GetPhrase("SelectLabel"),
               0 {FID},
               \System\DefFont);
  [
    PickBmpObj = \PickBMP(Invalid, Invalid, Invalid, 0, 0, &ImageFile);
  ]
  If Valid(ImageFile);
  [
    IfThen(ImageFile != 0 && StrLen(ImageFile) > 0,
      Parms\IconFile = ImageFile;
      ImgFilePath    = \FindFile(ImageFile);
    );
    ImageFile = Invalid;
  ]