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: RSSVGCtrls

expandingInheritance Hierarchy

TRSCustomTransparentGraphicControl
  RSSVGCtrls.TRSSVGThreadImage
 

expandingSyntax

Delphi

type 
  TRSSVGThreadImage = class(TRSCustomTransparentGraphicControl, IRSGPControl) 
  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

public property

AbsoluteMatrix

Represents property AbsoluteMatrix.

published property

Align

Represents property Align.

published property

Anchors

Represents property Anchors.

published property

AutoSize

Represents property AutoSize.

protected property

Bitmap

Represents property Bitmap.

published property

Constraints

Represents property Constraints.

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

DefaultColorInterpolation

Default Color interpolation type, which specifies the color space for gradient interpolations and alpha compositing

VCL Only

published property

DefaultColorRendering

Default Color rendering type, which provides a hint to the SVG library about how to optimize its color interpolation and compositing operations.

VCL Only

published property

DefaultShapeRendering

Default Shape rendering type, which provides a hint to the SVG library about what tradeoffs to make as it renders vector graphics elements such as path elements and basic shapes such as circles and rectangles.

VCL Only

published property

DefaultTextRendering

Default Text rendering type, which provides a hint to the SVG library about what tradeoffs to make as it renders text

VCL Only

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

DragCursor

Represents property DragCursor.

published property

DragKind

Represents property DragKind.

published property

DragMode

Represents property DragMode.

published property

Enabled

Represents property Enabled.

published property

Filename

Defines the filename of the SVG document to load

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.

public property

Matrix

Represents property Matrix.

published property

OnClick

Represents property OnClick.

published property

OnContextPopup

Represents property OnContextPopup.

published property

OnDblClick

Represents property OnDblClick.

published property

OnDragDrop

Represents property OnDragDrop.

published property

OnDragOver

Represents property OnDragOver.

published property

OnEndDock

Represents property OnEndDock.

published property

OnEndDrag

Represents property OnEndDrag.

published property

OnGesture

Represents property OnGesture.

published property

OnMouseActivate

Represents property OnMouseActivate.

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

OnStartDock

Represents property OnStartDock.

published property

OnStartDrag

Represents property OnStartDrag.

published property

Opacity

Specifies the opacity or transparency of the SVG image. If Opacity is less than 1, then the SVG is displayed semi- transparent. If Opacity is 0, then the SVG is not displayed.

published property

Options

Controls how the SVG is loaded and displayed

published property

ParentShowHint

Represents property ParentShowHint.

published property

PopupMenu

Represents property PopupMenu.

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

published property

ShowHint

Represents property ShowHint.

protected property

SVG

Represents property SVG.

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

Touch

Represents property Touch.

published property

Transform

Specifies the overall transformation to apply to the SVG image. For no transformation, set the Matrix to the RSIdentityMatrix

published property

Visible

Represents property Visible.

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.

public method

GetAbsoluteMatrix

Represents method GetAbsoluteMatrix.

public method

GetMatrix

Represents method GetMatrix.

public method

GetOpacity

Represents method GetOpacity.

protected method

GetShapeRect(TObject,TRSRect)

Represents method GetShapeRect(TObject,TRSRect).

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.

public method

SetOpacity(Single)

Represents method SetOpacity(Single).

protected method

UpdateBitmap

Represents method UpdateBitmap.

Top

expandingRemarks

alert_noteTip

The TRSSVGThreadImage always loads (Windows-only) 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