//// This code is part of Document Solutions for Imaging demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Drawing;usingGrapeCity.Documents.Imaging;usingGrapeCity.Documents.Svg; namespaceDsImagingWeb.Demos{// This sample shows how to render an SVGZ (compressed SVG) image. // The SVG art used in this sample is from freesvg.org.publicclassRenderSvgz {publicGcBitmapGenerateImage(Size pixelSize, float dpi, bool opaque, string[] sampleParams = null) {var svgPath = Path.Combine("Resources", "SvgMisc", "Smiling-Girl.svgz");usingvar svg = GcSvgDocument.FromSvgz(File.ReadAllBytes(svgPath)); // Render the SVG image and a border around it:var bmp = newGcBitmap(pixelSize.Width, pixelSize.Height, opaque, dpi, dpi);usingvar g = bmp.CreateGraphics(Color.White);var pt = newPointF(dpi, dpi); g.DrawSvg(svg, pt);var sz = svg.GetIntrinsicSize(SvgLengthUnits.Pixels); g.DrawRectangle(newRectangleF(pt, sz), Color.MediumPurple); // Done:return bmp; } }}