TIESVGParser
Properties · Methods · Demos · Examples
Declaration
TIESVGParser = class;
Description
A class for parsing the content of SVG files.
This class is used internally when:
◼Rendering an SVG to a bitmap
◼Importing an SVG as
vector layers
Demo
| Demos\InputOutput\SVGParsing\SVGParsing.dpr |
Examples
// Add a description of all SVG tags to a TMemo
lbxSvgTags.Items.BeginUpdate();
svgParser := TIESVGParser.Create();
try
svgParser.ParseSVG( Filename, nil, svgTags, svgTagCount );
for i := 0 to Length( svgTags ) - 1 do
begin
s := svgTags[i].Content;
if Length( s ) > MAX_LENGTH then
begin
SetLength( s, MAX_LENGTH );
s := s + '...';
end;
lbxSvgTags.Lines.Add( s );
end;
finally
lbxSvgTags.Items.EndUpdate();
svgParser.Free();
end;
// Manually render an SVG
svgParser := TIESVGParser.Create();
try
// Note: This will be the same as ImageEnView3.IO.ImportFromFileSVG() if Skia or ImageMagick is not being used
svgParser.ParseSVG( mySvgContent, ImageEnView1.IEBitmap, -1, -1, True );
ImageEnView1.Fit( False );
ImageEnView1.Update();
finally
svgParser.Free();
end;
Methods and Properties
General
SVG Properties
| SvgX: Double |
| SvgY: Double |
| SvgWidth: Double |
| SvgHeight: Double |
| SvgTagCount: Integer |
| SvgTitle: string |
| SvgViewBox: TRect |
| SvgBackground: TColor |
| SvgRawContent: string |