Picture Property

Applies To

Description

The Picture property specifies a bitmap, icon, or other image for an object.

For Button, Form, Group, MDIClient, Static, StatusBar, StatusField, SubForm, SM, TabBar or ToolBar, this property specifies the name of, or ref to, a Bitmap, Icon, or Metafile which is drawn as a background on the object. Other controls and graphical objects are drawn on top of this background.

When it refers to a Metafile, the Picture property specifies the name of, or ref to, the Metafile to be drawn in the object. When it refers to a Bitmap or Icon, the value of the Picture property is a 2-element vector whose elements specify the name of, or ref to, the Bitmap, or Icon, and the manner in which it is displayed. This is specified as an integer as follows:

0 The Bitmap or Icon is drawn in the top left corner of the object.
1 The Bitmap or Icon is tiled (replicated) to fill the object.
2 The Bitmap is scaled (up or down) to fit exactly in the object. This setting does not apply to an Icon whose size is fixed.
3 The Bitmap or Icon is drawn in the centre of the object. This is the default. Note that the centre of the Bitmap is positioned over the centre of the object, so that you see the middle portion of a Bitmap that is larger than the object in which it is displayed.

For example, the following statements produce a Form filled with the CARS bitmap.

      'CARS' ⎕WC 'Bitmap' 'C:\WINDOWS\CARS'
      'f1' ⎕WC 'Form' ('Picture' 'CARS' 1)

An easy way to provide a customised pushbutton is to create a Button whose Picture property specifies the name of, or ref to, a Bitmap or Icon, using drawmode 3 (the default). This causes the corresponding bitmap or icon to be drawn in the centre of the Button. So long as the Button is larger than the bitmap or icon, its borders (which give it its 3-dimensional appearance and "pushbutton" behaviour) will be unaffected.

Note that if Picture is set on a Button whose Style is 'Radio' or 'Check', the Button assumes pushbutton appearance, although its radio/check behaviour is preserved.

For an Image object, the Picture property specifies the name of, or ref to, a Bitmap, Icon or Metafile object to be drawn, or a vector of names or refs. The Image is a graphical object and is drawn on top of the background. It does not support the drawmode options provided by the objects in which Picture specifies the background.

For the Clipboard object, Picture is a "set-only" property that allows you to place a specified Bitmap object into the Windows clipboard. To place a Metafile object into the clipboard, use its Metafile property.