Image resources

The attributes and functions explained on this page can be found in the category Common.

Image resources

The image resource defines which image will be displayed in the Image Viewer. The intended use is to link as an image resource a ITcVnDisplayableImage symbol using the HMI.Vision extension. In general, however, the image resource only needs to be a valid image URL. This can be either a direct path in the project, a URL to an external server or a Data URL. This works analogously to the Src attribute of the standard image control.

In the simplest case, the image resource is specified via the Image attribute:

Image resources 1:

Furthermore, it is possible to store multiple image resources in the ImageList attribute:

Image resources 2:

The ImageIndex attribute can be used to select which of the resources is actually used. This can be used, for example, to easily switch between image symbols from the PLC. The switch can also be made graphically via the ImageSelection combo box in the toolbar. For this purpose, not only the respective image resource but also an associated image name can be assigned in the ImageList .

Image resources 3:
Image resources 4:

Simultaneous use of Image and ImageList is mutually exclusive

Internally, using the ImageList property causes the respective image symbol of the selected ImageList element to be bound to the Image symbol. Therefore, the use of Image and ImageList are mutually exclusive; you should not bind an image symbol to the Image attribute if you are already using ImageList.

Receive event

Each time the control receives a new image, the event onImageReceived is triggered.

Alternative text

If no image resource is specified or no valid image could be loaded from the specified resource, an alternative text is displayed. This can be changed by the Alt attribute and is "No image available." by default.

Image resources 5:

Image download

The currently displayed image can be saved locally on the client device via browser-specific download. The download can be triggered either by the downloadImage function or the download button in the toolbar.

The image is saved in its original size.

The file name can be specified as a parameter in programmatic calls. A file extension does not need to be specified as it is automatically appended. If the parameter remains empty, the file name is also created automatically. For a symbol, the symbol name is used first; for a data URL, the control name is used accordingly:

<symbol name/control name>_<date>_<time>-<MS>.<file extension>

For an image path, the file name and file extension from the specified path are used without appending a timestamp.

The selection of the save path is not possible within the control, but corresponds to the download path setting of the used browser. The usual download path is C:\User\<User>\Downloads\.

Image resources 6:

Requirements and restrictions of the image download

Since the image download is done via a browser-specific functionality, the possibilities, settings and functionality depend on the used web browser for the TwinCAT HMI Client.

The method downloadImage requires the authorization operate of the TwinCAT HMI user management.

This method does not work with images that are linked as a stream, as well as in the live view of HMI engineering.