picture

Type: Binary

Availability: Read or write at any time, but read or write at run time only for tables

The picture property contains a graphic to be displayed in a control or a menu.

The settings of the picture property are listed in the following table.

Value Description
(none) No picture (the default).
(Bitmap, icon, cursor, JPEG, PNG, GIF, TIFF CCITT, or metafile) Specifies a graphic. You can load the graphic from the Properties window in the JADE development environment. At run time, you can set this property, by using the loadPicture method on a bitmap, icon, metafile, GIF, JPEG, or PNG.

For a Button control defined for a Web page, the picture property is displayed as an image that can be clicked. For button controls, the picture is placed on the button to the left of the button caption. However, this property is ignored if the buttonPicture property of a button is set to a non-zero value.

When an icon image is assigned to button and the Button class autoSize property is not AutoSize_Picture, the size of the icon selected from the assigned icon image is now based on the client height of the button.

If the autoSize property is set, the picture is scaled to fit the button. The button picture painting colors the background of the picture to the background color of the button by using the drawFloodFill method.

When the button is disabled and an image is defined by the pictureDisabled property, this image is displayed instead.

For a Picture control on a Web page, the binary value is automatically converted to the Graphics Interchange Format (GIF), Joint Photographic Experts Group (JPEG), or Portable Network Graphics (PNG) image format, depending on the value specified in the ImageType parameter in the [WebOptions] section of the JADE initialization file. (The default value is jpg.)

When setting the picture property from the JADE Painter in the JADE development environment, the graphic is saved and loaded with the form. When you load a graphic at run time, the graphic is not saved with the application.

The graphic can be set by setting the picture property of the control to the picture property of another control or by using the loadPicture method of the Application class. For menus, the picture can be a bitmap, icon, cursor, portable network graphics image, or metafile. The picture is drawn at actual size, except for a metafile or on the menu bar of the form, when it is scaled to fit the menu line size.

Menus are drawn in four columns, as follows.

checkMark : picture : text : accelerator text

The width of each column is defined to be the maximum of all the displayed items in that popup menu.

The following examples show the use of the picture property.

buttonSelect_click(btn: Button input) updating;
vars
    file : CMDFileOpen;
begin
    pictureEnlarged.picture := null;
    create file;
    file.filter := "Pictures(*.bmp;*.ico)|*.bmp;*.ico";
    if file.open = 0 then
        pictureNormal.picture := app.loadPicture(file.fileName);
    endif;
end;
if logo.picture.length <> 0 then
    if product.logo = null  then
        create l;
    else
        l := product.logo;
    endif;
    l.loadSelf(logo.picture);
endif;

For the Picture control, the picture can be displayed as defined, it can be stretched to fit the control, or the control can be stretched to fit the picture size, according to the value of the stretch property.

For the Table control:

For GIF picture types:

When using an animated GIF picture, note the following.