Hide Comments
Hide Comments

Comments (0)

TRSSVGThreadImage displays a graphical image of a SVG. The control ensures that the image is always of the highest resolution by redrawing the SVG when the control is rescaled.

Use TRSSVGThreadImage to display a graphical image of a SVG on a form. Use the Filename or Lines properties to control which SVG is displayed in the image. TRSSVGThreadImage introduces several properties to determine how the SVG is displayed within the boundaries of the TRSSVGThreadImage object.

Namespace: FMX.RS.SVGCtrls

expandingInheritance Hierarchy

TControl
  FMX.RS.SVGCtrls.TRSSVGThreadImage
 

expandingSyntax

Delphi

type 
  TRSSVGThreadImage = class(TControl) 
  end; 
 

expandingConstructors

 

Name

Description

public constructor

Create(TComponent)

Initializes a new instance of the TRSSVGThreadImage class.

public destructor

Destroy

Represents the destructor of the TRSSVGThreadImage class.

Top

expandingProperties

 

Name

Description

published property

Align

Represents property Align.

published property

Anchors

Represents property Anchors.

protected property

Bitmap

Represents property Bitmap.

published property

ClipChildren

Represents property ClipChildren.

published property

ClipParent

Represents property ClipParent.

published property

Cursor

Represents property Cursor.

published property

DefaultAspectRatio

Defines the default aspect ratio for the SVG. If the SVG does not specify a preserveAspectRatio attribute, the SVG will use this default instead.

published property

DesignVisible

Represents property DesignVisible.

published property

DisableInterpolation

Enables or disables the interpolation of the SVG bitmap displayed by this TRSSVGThreadImage component.

The DisableInterpolation property specifies whether the interpolation is used while rendering the SVG bitmap onto the canvas displayed by this TRSSVGThreadImage component. By default, DisableInterpolation is set to False.
 

published property

DPI

Dots per inch used in calculating the unit factors for conversion of string lengths into actual values. The DPI should be set before loading a SVG.

For example, if the input string contains '1cm', the DPI helps the SVG library figure out how large a centimeter is.

published property

DragMode

Represents property DragMode.

published property

Enabled

Represents property Enabled.

published property

EnableDragHighlight

Represents property EnableDragHighlight.

published property

Filename

Defines the filename of the SVG document to load

published property

Height

Represents property Height.

published property

HitTest

Represents property HitTest.

published property

Lines

Defines the text of a SVG to load. The Lines property is useful for when you don't want to load a SVG from a file with the Filename property.

published property

Locked

Represents property Locked.

published property

Margins

Represents property Margins.

published property

MarginWrapMode

Specifies how the margins of the SVG are resized, replicated, and positioned.

Use MarginWrapMode property to set and get how the margins of the SVG are displayed within the TRSSVGThreadImage. By default the margins are stretched to fill the entire TRSSVGThreadImage.

If SVGMargins property is not set, then MarginWrapMode has no effect over the image.
 
 

published property

OnClick

Represents property OnClick.

published property

OnDblClick

Represents property OnDblClick.

published property

OnDragDrop

Represents property OnDragDrop.

published property

OnDragEnd

Represents property OnDragEnd.

published property

OnDragEnter

Represents property OnDragEnter.

published property

OnDragLeave

Represents property OnDragLeave.

published property

OnDragOver

Represents property OnDragOver.

published property

OnMouseDown

Represents property OnMouseDown.

published property

OnMouseEnter

Represents property OnMouseEnter.

published property

OnMouseLeave

Represents property OnMouseLeave.

published property

OnMouseMove

Represents property OnMouseMove.

published property

OnMouseUp

Represents property OnMouseUp.

published property

OnMouseWheel

Represents property OnMouseWheel.

published property

OnPaint

Represents property OnPaint.

published property

OnPainting

Represents property OnPainting.

published property

OnResize

Represents property OnResize.

published property

Opacity

Represents property Opacity.

published property

Options

Controls how the SVG is loaded and displayed

published property

Padding

Represents property Padding.

published property

PopupMenu

Represents property PopupMenu.

published property

Position

Represents property Position.

published property

RotationAngle

Represents property RotationAngle.

published property

RotationCenter

Represents property RotationCenter.

published property

Scale

Represents property Scale.

published property

ScaleOriginal

Specifies the scale factor for drawing the SVG.

Use the ScaleOriginal property to scale the SVG larger or smaller within the TRSSVGThreadImage component. This is useful for controlling the tiling the SVG or zooming in or out of the SVG

protected property

SVG

Represents property SVG.

published property

SVGMargins

Specifies the margins of the SVG displayed by this TRSSVGThreadImage component.

Set or read the SVGMargins property in order to affect the margins of the SVG that is displayed by this TRSSVGThreadImage component
 

published property

SVGRootID

Specifies which node of the SVGDocument to draw as the top- level SVG document.

Use the SVGRootID property to display only a portion of the SVG Document .

protected property

Thread

Represents property Thread.

published property

Visible

Represents property Visible.

published property

Width

Represents property Width.

published property

WrapMode

Specifies whether and how to resize, replicate, and position the SVG image for rendering the TRSSVGThreadImage surface.

The WrapMode property should be one of the constants defined in the TSVGImageWrapMode type:

iwOriginal-- displays the SVG with its original dimensions.

iwFit-- best fit (keeping SVG proportions--the ratio between the width and height) for the TRSSVGThreadImage rectangle. Default.

iwStretch--stretches the SVG to fill the entire rectangle of this TRSSVGThreadImage component.

iwTile--tiles the TRSSVGThreadImage image to cover the entire rectangle of the TRSSVGThreadImage component.

iwCenter-- center the SVG inside the TRSSVGThreadImage component
 

Top

expandingMethods

 

Name

Description

protected method

ClearPendingJobs(TSVGServerJob)

Represents method ClearPendingJobs(TSVGServerJob).

protected method

CreateServerThread

Represents method CreateServerThread.

protected method

DisplayPropertyChange

Represents method DisplayPropertyChange.

protected method

GetBitmap

Represents method GetBitmap.

protected method

JobComplete(TObject)

Represents method JobComplete(TObject).

protected method

LoadSVG

Represents method LoadSVG.

protected method

ObjectChanged(TObject)

Represents method ObjectChanged(TObject).

protected method

Paint

Represents method Paint.

protected method

Resize

Represents method Resize.

protected method

UpdateBitmap

Represents method UpdateBitmap.

Top

expandingRemarks

alert_cautionImportant Note

The TRSSVGThreadImage is very dependant on the thread-safety of the implementation of TBitmap/TCanvas. Unlike the VCL, there are known issues with TBitmap thread safety (at least as of XE5), even on Windows (DirectX2D implementation compared to GDI+ implementation). It is not recommended to use TRSSVGThreadImage in FMX - use TRSSVGImage and TRSSVGDocument instead.

alert_noteTip

The TRSSVGThreadImage always loads and draws the SVG image in a background thread. As such, it cannot share a TRSSVGDocument and must contain its own SVG. If you want or can share SVG documents amongst multiple image components (and don't mind using the GUI main thread), you may want to use the TRSSVGImage component.

alert_cautionWarning

If the SVGRootID property is not empty, the ID must exist in the SVG document or nothing is displayed.

alert_cautionImportant Note

On non-Windows systems, the TRSSVGThreadImage loads the SVG in the main thread and only does the painting in the background thread. This is because the ADOM XML parser, which is used on non-Windows system, crashes when used in background threads.

expandingExamples

To load and draw a SVG at run-time, create the SVG document and the SVG Image:

Delphi

 
 SVGImage := TRSSVGThreadImage.Create(Self);
 SVGImage.Parent := Self;
 SVGImage.Filename := 'c:\MySVG.svg';

expandingSee Also

Comments (0)

RiverSoftAVG SVG Component Library (RSCL) © 2013-2015, Thomas G. Grubb