'''' This code is part of Document Solutions for Imaging demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.ImagingImportsGrapeCity.Documents.Svg '' This short sample shows how to measure and render an SVG image.'' The SVG art used in this sample is from freesvg.org.PublicClassRenderSvgPublicFunctionGenerateImage(ByVal pixelSize AsSize,ByVal dpi AsSingle,ByVal opaque AsBoolean,OptionalByVal sampleParams AsString() = Nothing) AsGcBitmap '' Load the SVG:Dim svgPath = Path.Combine("Resources", "SvgClipArt", "Smiling-Girl.svg")Using svg = GcSvgDocument.FromFile(svgPath) '' Render the SVG image and a border around it:Dim bmp = NewGcBitmap(pixelSize.Width, pixelSize.Height, opaque, dpi, dpi)Using g = bmp.CreateGraphics(Color.White)Dim pt = NewPointF(dpi, dpi) g.DrawSvg(svg, pt)Dim sz = svg.GetIntrinsicSize(SvgLengthUnits.Pixels) g.DrawRectangle(NewRectangleF(pt, sz), Color.MediumPurple)EndUsing '' Done:Return bmpEndUsingEndFunctionEndClass