## The `bitmap' property

Integer matrix (also Character vector for Picture object)

Valid for: Chart, Form, Image, Picture, ToolButton, System object, Window

#### Specifying or reading an array of pixel values

The `bitmap` property can be used to represent an image as an APL integer matrix, where each element contains an RGB color for the corresponding pixel. The color value is encoded as 256Blue Green Red where each color value is in the range 0 to 255. You can also specify a boolean array, in which case 0 is interpreted as black and 1 as white.

For the Picture object, writing to the `bitmap` property causes the bitmap to be displayed. Reading it returns the current picture as an APL array of colors.

For the System object, writing to the `bitmap` property places the bitmap on the Clipboard, ready for pasting into another application. Reading the `bitmap` property returns any bitmap currently on the Clipboard as an APL array of color values. If there is no bitmap on the Clipboard, an empty array is returned.

For an Image object, the bitmap property can be used to create the image, or to retrieve it as an array of color values.

For a Chart, Form, or Window, the `bitmap` property is read-only. It returns an array of color values which correspond to the displayed object. (Under Linux, this property is not currently implemented for the Form or Window object. Under MacOS 9, it is valid for a Form or Window only if the window is completely visible on screen.).

For a ToolButton object, the `bitmap` property can contain between 1 and 4 images, laid out side by side. These are displayed on the button, depending on its state. The `imagecount` property determines how many images the bitmap holds.

#### Specifying a file name (Picture object only)

You can also use the `bitmap` property to specify the name of a file containing an image which will be displayed in a Picture object. The file can be a Windows bitmap (.bmp), JPEG picture (.jpg or .jpeg), or, on the Macintosh, a PICT image or any other file for which a Quicktime graphics converter is installed. Under Linux, the supported types depend on the operating system version but will typically include .png .xpm .jpg .jpeg .ico and .bmp files. Reading back the `bitmap` property always returns an APL array containing the pixels in the picture, so you can use this property to convert one of the supported image types to an APL bitmap array.

Topic: APLX Help : System Classes : Properties : bitmap

[ Previous | Next | Contents | Index ]