The ImageView (gb.form) component implements an image viewer.
Figure 17.18.1: Image display in an ImageView.
Figure 17.18.1: Image section with grid shown ( zoom factor = 10 )
The following table describes selected properties of an ImageView:
Property | Type | Description |
---|---|---|
Image | Image | Sets the image displayed in the ImageView or returns this image. |
Grid | Boolean | For the value True, a grid is displayed or returned for an integer zoom level greater than 2. |
UseMouse | Boolean | For the value True the ImageView reacts to mouse events or returns the value. |
Zoom | Float | Sets the zoom factor or returns the zoom factor. For example, the value 2 corresponds to twice the display size of the original image. |
Table 17.18.1.1: Properties of the ImageView component
Method | Description |
---|---|
EnsureVisible ( X As Integer, Y As Integer, W As Integer, H As Integer ) | Ensures that a specified area of the display area is visible. |
ImageToView ( ImagePoint As Point ) As Point | Converts an image point from image coordinates to ImageView coordinates. |
ViewToImage ( ViewPoint As Point ) As Point | Converts a point from ImageView coordinates to image coordinates. |
Update ( [ Image As Image ] ) | Replaces the displayed image in the ImageView with an image passed as an optional argument. The zoom factor is not reset during the update. |
ZoomFit ( ) | Adjusts the image to the size of the ImageView by setting the zoom level internally. |
Table 17.18.2.1: Overview of selected methods of the class ImageView
In project 1, you are presented with a simple image viewer → Figure 17.18.1. An image in grey tones is displayed as the start image. Via a dialogue (MultiSelect) you can select one picture or several pictures (picture list) in a directory.
In the second project you can learn about the close relationship between the two components ImageView and ScrollArea:
Figure 17.18.4.1: ScrollArea and ImageView