ImageEn, unit iexSVG

IEParseSVGShapeTag


Declaration

function IEParseSVGShapeTag(const TagContent: string; out X, Y, Width, Height: Double; out Shape: TIEShape; var StrokeWidth: Double; var StrokeColor: TColor;
                            var FillColor: TColor; var Opacity: Double; InitializeStyles: Boolean = True): Boolean; overload;
function IEParseSVGShapeTag(const Tag: TIESVGTag; PageScaleX, PageScaleY: Double; out X, Y, Width, Height: Double; out Shape: TIEShape; var StrokeWidth: Double; var StrokeColor: TColor;
                            var FillColor: TColor; var Opacity: Double; var ToRotate: Double; InitializeStyles: Boolean = True; ProcessTransforms: Boolean = True): Boolean; overload;


Description

Parse an SVG Rect, Circle or Ellipse tag and output the properties.
Shape will be returned as one of: iesEllipse, iesRectangle or iesRoundRect
If InitializeStyles is true, any styles not specified will be reset to SVG defaults.
If ProcessTransforms is true, any transforms attributes found in the tag will be used to move or scale the object (and the ToRotate var will be filled).
Result is false if the tag could not be parsed.



Demo

Demo  Demos\InputOutput\SVGParsing\SVGParsing.dpr


Examples

// Circle
IEParseSVGShapeTag( '<circle r="45" cx="450" cy="450" fill="red" stroke="green" stroke-width="3"/>', x, y, w, h, shape, strokeWidth, strokeColor, fillColor, opacity );

// Ellipse
IEParseSVGShapeTag( '<ellipse rx="100" ry="50" cx="520" cy="180" style="fill:yellow;stroke:green;stroke-width:3"/>', x, y, w, h, shape, strokeWidth, strokeColor, fillColor, opacity );

// Rect
IEParseSVGShapeTag( '<rect x="10" y="520" height="110" width="200" style="fill:#666666;stroke:green;stroke-width:0"/>', x, y, w, h, shape, strokeWidth, strokeColor, fillColor, opacity );

// Round Rect
IEParseSVGShapeTag( '<rect x="600" y="500" height="50" width="50" rx="5" ry="5" fill="red" stroke="green" stroke-width="3"/>', x, y, w, h, shape, strokeWidth, strokeColor, fillColor, opacity );


See Also

 ParseSVG
 IEParseSVGImageTag
 IEParseSVGLineTag
 IEParseSVGPathTag
 IEParseSVGPolyTag
 IEParseSVGTextTag