Advanced SVG Image

BrowseName: AdvancedSVGImage
SuperType: Container (Container)
TypeView path: Tipi > UI > Disegni > Immagine SVG avanzata

Displays an SVG Tiny 1.2 image and makes it possible to change the properties of individual parts of the image at design time or at runtime.

Applications

Typically used to modify statically or dynamically part or all the colors of an SVG image, for example, icons, dynamic images depending on specific runtime logic, or backgrounds of other objects (see Image object). Makes it possible to perform the following actions:

Configure the object

Set the image to display

  1. In UI, right-click the desired container (MainWindow (type), Panel…), then select New > Designs > Advanced SVG image: the new object appears.

  2. Next to the Path property of the object, click Browse: the Select file folder opens.

  3. Click on the desired image, then click Select: the image appears in the Objects editor.

Set a customized color for a section of the image

Prerequisite: to modify parts of the image, the different parts must be identified by specific IDs in the SVG file.

  1. Click image505BCEB6 next to SVG element properties: the new property appears.

  1. In ID, select the desired section of the image.

  2. In Properties, select the Color property to change the color of the section of interest.

  3. Next to Value, click Select Color and select the desired color, or enter the hexadecimal code of the desired color.

Set the change at runtime of the section color

Prerequisite: to modify parts of the image, the different parts must be identified by specific IDs in the SVG file.

  1. Click image505BCEB6 next to SVG element properties: the new property appears.

  2. In ID, select the desired section of the image.

  3. In Properties, select the Color property to change the color of the section of interest.

  4. Next to Value, click imageD7368BBD > Advanced to open the Dynamic Links editor, then select the property of the desired object.

Resize an image keeping the original proportions

  1. In Fill Mode, select Fill.

  2. Set a value for one of the two dimensions, for example set Height to 50 pixels.

  3. Set the value of the other dimension to Auto. To do it, click properties, for example Width, and press DELETE.

The image assumes the desired height, while the width stretches to keep the original aspect ratio.

../../../_images/ref_image_originalRatio_ex.gif

Properties

Name

BrowseName

DataType

Description

Path

Path

ResourceUri

Path

Fill Mode

FillMode

FillModeEnum

Fill mode of the image object (Fill = resize the image keeping the original aspect ratio, Fit = resize the image by fitting the aspect ratio to the area of the image object)

Hit test visible

HitTestVisible

Boolean

True = intercept user clicks. False = does not intercept user clicks, which are instead passed to the underlying object, based on the order on the z axis.

SVG Element Properties

SVGElementProperties

Collection of AdvancedSVGImageElementProperty

Set the color of a part of the SVG file

Visible

Visible

Boolean

Show/hide the window.
(Inherited from Element)
Enabled

Enabled

Boolean

Enables/disables the interaction with the user (True = enabled; False = disabled).
(Inherited from Element)
Opacity

Opacity

Float

Opacity level (0 = transparent)
(Inherited from Element)
Left margin

LeftMargin

Size

(Only if Horizontal Alignment = Left or Center or Stretch) Distance between the left edge of the object and the left edge of its container.
(Inherited from Element)
Top margin

TopMargin

Size

(Only if Vertical Alignment = Top or Center or Stretch) Distance between the top edge of the object and the top edge of its container.
(Inherited from Element)
Right margin

RightMargin

Size

(Only if Horizontal Alignment = Right or Center or Stretch) Distance between the right edge of the object and the right edge of its container.
(Inherited from Element)
Bottom margin

BottomMargin

Size

(Only if Vertical Alignment = Bottom or Center or Stretch) Distance between the bottom edge of the object and the bottom edge of its container.
(Inherited from Element)
Width

Width

Size

Width of the window. It can assume values greater than or equal to zero. The Auto value sets the width equal to the width of the content (in this case, in the absence of content the object collapses).
(Inherited from Element)
Height

Height

Size

Height of the window. It can assume values greater than or equal to zero. The Auto value sets the height equal to the height of the content (in this case, in the absence of content the object collapses).
(Inherited from Element)
Horizontal alignment

HorizontalAlignment

HorizontalAlignment

Alignment of the object on the horizontal axis. Left = the left side is positioned on the left side of the container, except for the left margin; Right = the right side is positioned on the right side of the container, except for the right margin; Center = the center of the object is positioned in the center of the container, except for the left and/or right margins; Stretch = object width equals container width, except for the left and/or right margins.
(Inherited from Element)
Vertical alignment

VerticalAlignment

VerticalAlignment

Alignment of the object on the vertical axis. Top = the top side is positioned on the top side of the container, except for the top margin; Bottom = the bottom side is positioned on the bottom side of the container, except for the bottom margin; Center = the center of the object is positioned in the center of the container, except for the top and/or bottom margins; Stretch = object height equals container height, except for the top and/or bottom margins.
(Inherited from Element)
Rotation

Rotation

Size

Rotation of the object around its center point. Positive values indicate clockwise arc degrees.
(Inherited from Element)

Events

MouseDown event

BrowseName: MouseDownEvent

MouseUp event

BrowseName: MouseUpEvent