Search
Shape.FromSvg Method (SvgContent, Boolean)
See Also
 





Creates a Shape from the outline of an SVG drawing.

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming

 Syntax

C#  Copy Code

public static Shape FromSvg (
    SvgContent svgContent,
    bool stretch
)

Visual Basic  Copy Code

Public Shared Function FromSvg( _
    svgContent As SvgContent, _
    stretch As Boolean _
) As Shape

 Parameters

svgContent

An SvgContent object representing the SVG drawing.

stretch
Sets whether the Shape outline generated from SVG should be stretched to fill the entire shape definition range [0-100, 0-100], or should be scaled uniformly to preserve the original aspect ratio of the drawing. In effect, this specifies whether the shape will match the SVG drawing when ContentAlign is set to Stretch or Fit.

 Return Value

A Shape generated from the specified SVG drawing.

 Remarks

SVG drawings do not contain intrinsic semantic information about which elements of a drawing should be considered its outline. However the Shape class is primarily concerned with the outlines of nodes, for drawing, hit-testing and link alignment purposes. If you need the filled interior of nodes and the positions of links connected to them to match the SVG content, call this method to generate a shape outline from SVG, and assign the result to the nodes' Shape property. The shape outline is generated using a convex-hull algorithm.

 See Also