Click or drag to resize
AB4D logo

ReaderSvgConvertTransformationsToMatrixTransform Property

Gets or sets a Boolean that specifies if all transformations are converted to MatrixTransform. Default values is false that preserves the type of transformation defined in svg file.

Namespace:  Ab2d
Assembly:  Ab2d.ReaderSvg (in Ab2d.ReaderSvg.dll) Version: 7.1.7295.1040
Syntax
C#
public bool ConvertTransformationsToMatrixTransform { get; set; }

Property Value

Type: Boolean
Remarks

ConvertTransformationsToMatrixTransform gets or sets a Boolean that specifies if all transformations are converted to MatrixTransform.

Default values is false that preserves the type of transformation defined in svg file.

For example the following svg transform value: "translate(100,30) rotate(30)" will be converted into the following XAML when ConvertTransformationsToMatrixTransform is set to false (note that the order of transformation need to be reversed):

<Canvas.RenderTransform>
    <TransformGroup>
        <RotateTransform Angle="30" />
        <ScaleTransform ScaleX="100" ScaleY="30"/>
    </TransformGroup>
</Canvas.RenderTransform>

When ConvertTransformationsToMatrixTransform is set to true, then all transformation will be converted into MatrixTransform - the following XAML will be created:

<Canvas.RenderTransform>
    <MatrixTransform Matrix="0.8660,0.5,-0.5,0.8660,100,30" />
</Canvas.RenderTransform>

NOTE:
ConvertTransformationsToMatrixTransform property controls what WPF objects are created from transformation defined in svg file.

When exporting the WPF objects to XAML, you can also control how transformations are written to XAML. They can be written as elements (as shown above) or as simple RenderTransform attribute: RenderTransform="0.8660,0.5,-0.5,0.8660,100,30". This is controlled by WriteTransformationsAsElement property of XamlWriterSettings class.

See Also