Click or drag to resize
CanvasSvgDocumentLoadElementAsync Method
[Win10_15063] Loads an SVG element from a stream containing an XML fragment.

Namespace:  Microsoft.Graphics.Canvas.Svg
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public IAsyncOperation<CanvasSvgNamedElement> LoadElementAsync(
	IRandomAccessStream stream
)

Parameters

stream
Type: Windows.Storage.StreamsIRandomAccessStream

Return Value

Type: IAsyncOperationCanvasSvgNamedElement
Remarks

This API is only available when running on Windows 10 build 15063 (Creators Update) or greater.

The passed-in stream needs to contain valid SVG XML. It should have one root node. It doesn't necessarily have to be a complete document, though.

After creation, the element is not automatically added to the tree. You can add it to the document tree, for example, using Root or AppendChild(ICanvasSvgElement). You can add an element to a document that isn't the one used to create it. Just, the document and the element need to share the same device.

See Also