Toolbar

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

The controls in the toolbar can be used to interactively perform various actions that are otherwise only accessible via the attributes. Each element can be shown or hidden. In addition, the entire toolbar can be adjusted in height or completely hidden.

The positioning of the elements in the toolbar is fixed and cannot be customized. If such adjustments are nevertheless necessary, you can hide the corresponding elements using the property ToolbarItems and implement them yourself with your own controls and place them on the Image Control toolbar. The available toolbar elements from left to right are:

Toolbar 1:

ImageSelection

Combo box for selecting images from the image list to be displayed (see property ImageList in the category Common). Only displayed if the image list contains at least one element. When switching between images, expect a short loading time.

ScaleSelection

Combo box for selecting specific scaling values to adjust the current image. The selectable scaling values can be adjusted via the property ScaleOptions.

If ScaleSelectionEditable is deactivated while a user-defined scale is set, the combo box will no longer display a value. This is the default behavior of the combo box control.

ShapeButton

Button for setting the value of the ScaleSelectionActive property. If active, an existing shape is displayed and can be edited. If no shape is displayed, a new one can be drawn.

FreezeButton

Button for setting the value of the ImageFreeze property. If active, the currently displayed image is fixed and will not be updated.

DownloadButton

Button for downloading the current image with default name (see function downloadImage under Image download). To assign a different file name, this button can be implemented by the customer and then call the function with a self-defined name.

Toolbar 2:

Functions also programmatically accessible

Any action that is accessible through the interface elements of the toolbar is also accessible programmatically through the properties of the control.

Size settings

The toolbar offers customization options for its own height via the ToolbarHeight property and for the width of the two combo boxes properties ImageSelectionWidth and ScaleSelectionWidth. The width of the three additional buttons is automatically adjusted to the height of the toolbar so that they are square.

The width of the dropdown button of the combo boxes cannot be adjusted, because this functionality is not available in the standard combo box control.

Internally, the property ToolbarHeight is limited to a maximum of 150 pixels.

Background color

The background color of the toolbar is a semi-transparent white "rgba(255, 255, 255, 127)" by default and can be customized using the BarColor property in the category Colors.

Advanced settings

Further graphical settings (e.g. font of the combo boxes) can be changed via Themed Resources. Basically, attributes of the combo boxes are provided. Themed Resources can be customized in the theme editor at TcHmiVnImage > Themed Resources. These settings will then apply to all instances of the Image Viewer control.