SvgTransform Class

https://svgwg.org/svg2-draft/coords.html#InterfaceSVGTransform

public sealed class SvgTransform

Properties

NameDescription
AngleGets the angle, in degrees, of a rotation or skew transform, and 0 for the other types.
MatrixThe matrix of the transform (https://svgwg.org/svg2-draft/coords.html#__svg__SVGTransform__matrix); modifying it changes the type to SVG_TRANSFORM_MATRIX.
TypeGets the type of the transform, one of the SVG_TRANSFORM_* constants.

Gets the angle, in degrees, of a rotation or skew transform, and 0 for the other types.

public float Angle { get; }

The matrix of the transform (https://svgwg.org/svg2-draft/coords.html#__svg__SVGTransform__matrix); modifying it changes the type to SVG_TRANSFORM_MATRIX.

public DomMatrix Matrix { get; }

Gets the type of the transform, one of the SVG_TRANSFORM_* constants.

public ushort Type { get; }

Methods

NameDescription
SetMatrix(DomMatrix2DInit?)Sets the transform to the given matrix and its type to SVG_TRANSFORM_MATRIX.
SetRotate(float, float, float)Sets the transform to a rotation by the given angle, in degrees, around the given center.
SetScale(float, float)Sets the transform to a scale by the given factors.
SetSkewX(float)Sets the transform to a skew along the x axis by the given angle, in degrees.
SetSkewY(float)Sets the transform to a skew along the y axis by the given angle, in degrees.
SetTranslate(float, float)Sets the transform to a translation by the given offsets.

SetMatrix(DomMatrix2DInit?)

SvgTransform.cs

Sets the transform to the given matrix and its type to SVG_TRANSFORM_MATRIX.

public void SetMatrix(DomMatrix2DInit? matrix = null)

SetRotate(float, float, float)

SvgTransform.cs

Sets the transform to a rotation by the given angle, in degrees, around the given center.

public void SetRotate(float angle, float cx, float cy)

SetScale(float, float)

SvgTransform.cs

Sets the transform to a scale by the given factors.

public void SetScale(float sx, float sy)

SetSkewX(float)

SvgTransform.cs

Sets the transform to a skew along the x axis by the given angle, in degrees.

public void SetSkewX(float angle)

SetSkewY(float)

SvgTransform.cs

Sets the transform to a skew along the y axis by the given angle, in degrees.

public void SetSkewY(float angle)

SetTranslate(float, float)

SvgTransform.cs

Sets the transform to a translation by the given offsets.

public void SetTranslate(float tx, float ty)

Constants

NameDescription
SvgTransformMatrixThe type of a transform defined by a matrix.
SvgTransformRotateThe type of a rotation.
SvgTransformScaleThe type of a scale.
SvgTransformSkewXThe type of a skew along the x axis.
SvgTransformSkewYThe type of a skew along the y axis.
SvgTransformTranslateThe type of a translation.
SvgTransformUnknownThe type of a transform that is not one of the other types.

SvgTransformMatrix

The type of a transform defined by a matrix.

public const ushort SvgTransformMatrix = 1

SvgTransformRotate

The type of a rotation.

public const ushort SvgTransformRotate = 4

SvgTransformScale

SvgTransformSkewX

The type of a skew along the x axis.

public const ushort SvgTransformSkewX = 5

SvgTransformSkewY

The type of a skew along the y axis.

public const ushort SvgTransformSkewY = 6

SvgTransformTranslate

The type of a translation.

public const ushort SvgTransformTranslate = 2

SvgTransformUnknown

The type of a transform that is not one of the other types.

public const ushort SvgTransformUnknown = 0