{
var mem_strm = await QueuedTask.Run(() =>
{
//Create a point symbol
var pointSymbol = SymbolFactory.Instance.ConstructPointSymbol(
ColorFactory.Instance.RedRGB, 24, SimpleMarkerStyle.RoundedSquare);
//Generate image returns a stream
return SymbolFactory.Instance.GenerateImage(
pointSymbol, OutputImageFormat.SVG, 2.0, true, 300, 100, 100,
ColorFactory.Instance.WhiteRGB);
});
//Set the memory stream position to the beginning
mem_strm.Seek(0, SeekOrigin.Begin);
//File path and name for saving the SVG file
var fileName = "RoundedSquareSymbol.svg";
string path_svg = System.IO.Path.Combine(System.IO.Path.GetTempPath() + fileName);
//Write the memory stream to the file
System.IO.File.WriteAllBytes(path_svg, mem_strm.ToArray());
//////////////////////////////////////////////
//Note: to convert SVG to image format, use a 3rd party
//e.g. Aspose.SVG for .NET, for example convert SVG to PNG
//using (var svg_doc = new Aspose.Svg.SVGDocument(path_svg))
//{
// string path_png = Path.Combine(Path.GetTempPath() + "RoundedSquareSymbol.png");
// using (var img_png = new Aspose.Svg.Rendering.Image.ImageDevice(
// new ImageRenderingOptions(ImageFormat.Png), path_png))
// {
// svg_doc.RenderTo(img_png);
// }
// //also: https://docs.aspose.com/imaging/net/convert-svg-to-png/
//}
}