Polygon (Interactive)

The Polygon (Interactive) Control provides an environment to display a polygon or draw it by clicks. The control is mainly used within the Image Watch control, but it can also be used stand-alone. In addition to a polygon, lines or individual points, for example, can also be displayed or drawn. To do this, the NumPoints property must be set to 1 or 2 accordingly.

Polygon (Interactive) 1:

For all the following attributes, the control has a getter and a setter method. All further attributes, events and permissions provided by the base class Controls can be found in the TwinCAT HMI documentation.

Category: Colors

Attribute

Type

Description

StrokeColor

SolidColor

Color of the contours of the drawn polygon.

HandleColor

SolidColor

Color of the handles of the drawn polygon.

Category: Common

Attribute

Type

Description

ShapeData

PolygonData

Contains the description of the polygon. Can be used both to retrieve a drawn polygon and to set a specific polygon.

NumPoints

Number

Specifies how many points the complete polygon should have. At 0, any number of points are possible. This specification is important to be able to handle the polygon as complete.

Closed

Boolean

Indicates whether the polygon is closed or whether it is a polyline.

Function

Description

clear

Deletes the painted polygon and description from the ShapeData attribute.

Category: Usage

Attribute

Type

Description

RotationHandle

Boolean

Displays an element on the outside of the polygon to rotate it.

AngleInterval

Number

Specifies the steps in which the polygon can be rotated. At 0, the polygon can be rotated as desired.

Boundary

Boundary

Defines an area in which the shape can be drawn and edited using the five properties "X", "Y", "Width", "Height" and "IsActive". The shape cannot leave this area.

DataUpdate

DataUpdate

Specifies whether ShapeData should be updated during "onChanged" or at the end "onConfirmed" of a graphical interaction.

Category: Appearance

Attribute

Type

Description

StrokeThickness

MeasurementValue

Line thickness of the polygon.

HandleSize

MeasurementValue

Size of the elements to move and change the polygon.

ClickableSize

MeasurementValue

Size of the clickable area around above elements to move and change the polygon. This can simplify touch screen use without changing the appearance.

Offset

Vector2

Specifies the offset with which the shape is to be displayed.

Scale

Number

Specifies the scaling in which the shape is to be displayed. The value 1 corresponds to 100%.

Events

Event

Description

.onShapeChanged

This event is triggered as soon as the attribute ShapeData changes.

.onShapeConfirmed

This event is triggered when a shape is set or an interaction with it is completed.