Class SVGTransform
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The SVGTransform interface reflects one of the component transformations within an SVGTransformList; thus, an SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute.
[Value("SVGTransform")]
public class SVGTransform
- Inheritance
-
SVGTransform
- Inherited Members
Remarks
An SVGTransform object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Constructors
SVGTransform()
public SVGTransform()
Fields
SVG_TRANSFORM_MATRIX
[Value("SVG_TRANSFORM_MATRIX")]
public const ushort SVG_TRANSFORM_MATRIX = 1
Field Value
SVG_TRANSFORM_ROTATE
[Value("SVG_TRANSFORM_ROTATE")]
public const ushort SVG_TRANSFORM_ROTATE = 4
Field Value
SVG_TRANSFORM_SCALE
[Value("SVG_TRANSFORM_SCALE")]
public const ushort SVG_TRANSFORM_SCALE = 3
Field Value
SVG_TRANSFORM_SKEWX
[Value("SVG_TRANSFORM_SKEWX")]
public const ushort SVG_TRANSFORM_SKEWX = 5
Field Value
SVG_TRANSFORM_SKEWY
[Value("SVG_TRANSFORM_SKEWY")]
public const ushort SVG_TRANSFORM_SKEWY = 6
Field Value
SVG_TRANSFORM_TRANSLATE
[Value("SVG_TRANSFORM_TRANSLATE")]
public const ushort SVG_TRANSFORM_TRANSLATE = 2
Field Value
SVG_TRANSFORM_UNKNOWN
[Value("SVG_TRANSFORM_UNKNOWN")]
public const ushort SVG_TRANSFORM_UNKNOWN = 0
Field Value
Properties
Angle
The angle read-only property of the SVGTransform interface represents the angle of the transformation in degrees.
[Value("angle")]
public Number Angle { get; }
Property Value
- Number
An
integer; the angle value in degrees as a float.
Remarks
For SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX, and SVG_TRANSFORM_SKEWY, angle reflects the transformation's rotation or skewing angle.
For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero.
Matrix
The matrix read-only property of the SVGTransform interface represents the transformation matrix that corresponds to the transformation type.
[Value("matrix")]
public DOMMatrix Matrix { get; }
Property Value
Remarks
In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX.
Type
The type read-only property of the SVGTransform interface represents the type of transformation applied, specified by one of the SVG_TRANSFORM_* constants defined on this interface.
[Value("type")]
public ushort Type { get; }
Property Value
- ushort
An
integer; the type of value as an unsigned short.
Remarks
Methods
SetMatrix(DOMMatrix2DInit)
The setMatrix() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation.
[Value("setMatrix")]
public GlobalObject.Undefined SetMatrix(DOMMatrix2DInit matrix = null)
Parameters
matrixDOMMatrix2DInit
Returns
- GlobalObject.Undefined
None ('undefined').
Remarks
Note that the values from the parameter matrix are copied, meaning changes to the matrix object after calling this method will not affect the transformation.
SetRotate(Number, Number, Number)
The setRotate() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_ROTATE, with parameter angle defining the rotation angle and parameters cx and cy defining the optional center of rotation.
[Value("setRotate")]
public GlobalObject.Undefined SetRotate(Number angle, Number cx, Number cy)
Parameters
Returns
- GlobalObject.Undefined
None ('undefined').
Remarks
SetScale(Number, Number)
The setScale() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_SCALE, with parameters sx and sy defining the scale amounts.
[Value("setScale")]
public GlobalObject.Undefined SetScale(Number sx, Number sy)
Parameters
Returns
- GlobalObject.Undefined
None ('undefined').
Remarks
SetSkewX(Number)
The setSkewX() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_SKEWX, with parameter angle defining the amount of skew along the X-axis.
[Value("setSkewX")]
public GlobalObject.Undefined SetSkewX(Number angle)
Parameters
angleNumber
Returns
- GlobalObject.Undefined
None ('undefined').
Remarks
SetSkewY(Number)
The setSkewY() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_SKEWY, with parameter angle defining the amount of skew along the Y-axis.
[Value("setSkewY")]
public GlobalObject.Undefined SetSkewY(Number angle)
Parameters
angleNumber
Returns
- GlobalObject.Undefined
None ('undefined').
Remarks
SetTranslate(Number, Number)
The setTranslate() method of the SVGTransform interface sets the transform type to SVG_TRANSFORM_TRANSLATE, with parameters tx and ty defining the translation amounts.
[Value("setTranslate")]
public GlobalObject.Undefined SetTranslate(Number tx, Number ty)
Parameters
Returns
- GlobalObject.Undefined
None ('undefined').