ImageEn, unit iexSVG

IEParseSVGStyleAttributes


Declaration

procedure IEParseSVGStyleAttributes(const Tag: string; var StrokeWidth: Double; var StrokeColor: TColor; var FillColor: TColor; var Opacity: Double; StyleDefinitions: TStringList = nil; InitializeValues: Boolean = True);


Description

Parse a tag or style content and return the found style attributes.
To parse a CSS style it must be wrapped in {...}, e.g. "{fill:#ffffff;fill-rule:evenodd;fill-opacity:1;stroke:none;}" .

If InitializeValues = True, values that are not found will be reset to the SVG defaults.



Demo

Demo  Demos\InputOutput\SVGParsing\SVGParsing.dpr


Examples

IEParseSVGStyleAttributes( '<path d="M 10 80 Q 95 10 180 80" stroke="black" fill="white"/>', strokeWidth, strokeColor, fillColor, opacity );

IEParseSVGStyleAttributes( '{fill:#ffffff;fill-rule:evenodd;fill-opacity:1;stroke:none;}', strokeWidth, strokeColor, fillColor, opacity );


See Also

ParseSVG
IEGetSVGTagType
IEParseSVGFontAttributes