'''' This code is part of Document Solutions for Imaging demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsSystem.Collections.GenericImportsSystem.LinqImportsSystem.NumericsImportsGrapeCity.Documents.DrawingImportsGrapeCity.Documents.TextImportsGrapeCity.Documents.ImagingImportsGrapeCity.Documents.Svg '' Use GcSvgDocument to render a few images used as illustrations'' in the SVG spec.PublicClassSvgSpecArtPublicFunctionGenerateImage(ByVal pixelSize AsSize,ByVal dpi AsSingle,ByVal opaque AsBoolean,OptionalByVal sampleParams AsString() = Nothing) AsGcBitmap '' Load images from resources:Dim fnames AsNewList(OfString) From {"dash-path.svg", "opacity.svg", "paths.svg", "shadowstyle.svg", "units.svg" }Dim images AsNewList(OfTuple(OfString, GcSvgDocument))()ForEach f In fnames images.Add(Tuple.Create(f, GcSvgDocument.FromFile(Path.Combine("Resources", "SvgSpecArt", f))))Next Dim margin AsSingle = dpi / 2.0FDim gapy AsSingle = dpi / 4.0FDim ip AsNewPointF(margin, margin) '' Render the images:Dim bmp = NewGcBitmap(pixelSize.Width, pixelSize.Height, opaque, dpi, dpi)Using g = bmp.CreateGraphics(Color.White)For i AsInteger = 0To images.Count() - 1Dim svg = images(i).Item2Dim s = svg.GetIntrinsicSize(SvgLengthUnits.Pixels) g.DrawSvg(svg, ip) ip.Y += s.Height + gapyNextEndUsing '' Dispose images after saving the result: images.ForEach(Sub(t_) t_.Item2.Dispose()) '' Done:Return bmpEndFunctionEndClass