Esempio n. 1
0
		public static SvgDocument Parse(XmlDocument document)
		{
			var svgDocument = new SvgDocument();
			var rootElement = new SvgSvgElement(svgDocument, document.DocumentElement);

			var childNodes = new Collection<SvgElement>();
			childNodes.Add(rootElement);
			svgDocument._ChildNodes = childNodes;
			svgDocument.RootElement = rootElement;

			return svgDocument;
		}
Esempio n. 2
0
		public static Task RendererImageAsync(Stream stream, SvgDocument svg, SvgImageRendererFileFormat format, CancellationToken token)
			=> ThreadPool.RunAsync(_ => RendererImage(stream, new SvgImageRendererSettings { Document = svg, Format = format })).AsTask(token);
Esempio n. 3
0
		public static Task RendererImageAsync(StorageFile file, SvgDocument svg, SvgImageRendererFileFormat format, CancellationToken token)
			=> RendererImageAsync(file, new SvgImageRendererSettings { Document = svg, Format = format }, CancellationToken.None);
Esempio n. 4
0
 public SvgRendererBase(SvgDocument targetDocument)
 {
     this.TargetDocument  = targetDocument;
     this.LengthConverter = new SvgLengthConverter();
 }