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 |
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.
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
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
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:
The current sheet, row, and column properties define the picture access.
If the cell is too small to fit both the text and the picture, the text takes precedence over the picture unless the stretch property is set to Stretch_None_Picture_First (2) or Stretch_Cell_Picture_First (3), where the picture takes precedence.
The size of the text is determined by taking the cell size and calculating the required text size using the word wrap option. The space that is left over is used to scale the image proportionally, so that the whole image is displayed.
If the stretch property for the table control is set to Stretch_None (0), the picture is drawn to actual size. If it does not fit the available space, it is truncated on the right and bottom.
For GIF picture types:
Only the first image in the file is displayed, by default.
Only .gif files containing images are handled. (Text records within a .gif file are ignored.)
The FreeImage library used by JADE does not support the ability to convert images to .gif files.
Animated GIF handling is supported if the picture property of a Picture or JadeMask control is set to a GIF binary that contains more than one image. That control then runs the animation on a separate thread in a similar way to the Picture control setPicture method list and play mechanism.
Use of an animated GIF file is mutually exclusive with the use of the Picture control pictureCount and setPicture methods. Setting the picture property to an animated GIF removes any pictures created by using the setPicture method.
Similarly, changing the value of the pictureCount property or using the setPicture method closes any animated GIF operation (but leaves the value of the picture property unchanged).
An animated GIF file commences animation when the control first paints.
The animation loops indefinitely.
Although GIF files have the ability to require user input before continuing from an animation point, this requirement for user input is ignored by JADE.
Text display records within a GIF file are ignored.
When using an animated GIF picture, note the following.
Animated .gif files are not drawn stretched. The stretch property is used to resize the control to the GIF image if required, but the animation is always drawn at its normal size.
You can use the play and stop methods with an animated .gif file. The .gif file then starts playing automatically when the control is first painted, unless the stop method has been called.
After calling the stop method for an animated .gif file, you must then call the play method to start or continue the animation.