Image

This component displays an image.

This is what an image component looks like:

Common Properties

Width, Height, Bindings, Enabled, Visible, Border, Cursor, Tooltip, Focusable, Popup Menu

Custom Properties

Alignment

Horizontal alignment of text within label display area.

Possible values:

Description

Value

Left

2

Center

0

Right

4

Property name: horizontalAlignment

Property type: Integer

Vertical Alignment

Vertical alignment of text within label display area.

Possible values:

Description

Value

Top

1

Center

0

Bottom

3

Property name: verticalAlignment

Property type: Integer

Image Table

This is a tabular property with two columns: Image ID and Image Data. See Image Expression for more information.

Field

Type

Description

Image ID

String

Unique ID of the image in this table.

Image Data

Data Block

Image data.

Property name: imageTable

Property type: Data Table

Example: To show the photo of user admin in the image component, create the following binding:

Target: form/image1:imageTable$imageData[0]

Expression: {users.admin:photo$photo}

Image Expression

When image expression is set to a non-empty value, it is evaluated:

  • If expression evaluates to a String, image with ID matching this string is selected from Image Table and displayed by this component.
  • If it evaluates to an Image, it is immediately displayed by this component. See variable definition properties and context properties in References article for more information about how an expression may resolve to an image.

Property name: expression

Property type: String

Since image expression is not a part of widget binding, it will not be recalculated when properties and components referred by it are changed. It will be recalculated in the following cases only:

  • Upon widget startup
  • When the Image Expression property itself is changed by a widget binding

Thus, if you want the image contents to be changed upon certain event, do the following:

  • Create a widget binding those target points to the Image Expression, e.g.: form/image1:expression
  • Make binding expression what constructs another expression (Image Expression). The latter will be used to find an Image Table entry to display. For example, to select an image according to the value selected in the Combo Box, use the following binding expression: "'" + {form/comboBox1:selectedItem} + "'". This binding expression will construct Image Expression strings, such as 'image1'.

To make an animated image, add two pictures to the image table and create the following periodic binding:

Target: form/image1:expression

Expression: {form/image1:expression}=="'image1'"?"'image2'":"'image1'"

This binding will switch the image every time it's executed.

Common Events

Hidden, Shown, Moved, Resized, Mouse Clicked, Mouse Pressed, Mouse Released, Mouse Entered, Mouse Exited, Mouse Moved, Mouse Wheel Moved, Key Typed, Key Pressed, Key Released, Focus Gained, Focus Lost

Was this page helpful?