Class SVGTransform
Namespace: Aspose.Html.Dom.Svg.DataTypes
Assembly: Aspose.HTML.dll (25.2.0)
SVGTransform is the interface for 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 specification.
[DOMObject]
[ComVisible(true)]
[DOMName("SVGTransform")]
public class SVGTransform : SVGValueType, INotifyPropertyChanged, IDisposable
Inheritance
object ← DOMObject ← SVGValueType ← SVGTransform
Implements
INotifyPropertyChanged, IDisposable
Inherited Members
SVGValueType.Dispose(), SVGValueType.Dispose(bool), DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Fields
SVG_TRANSFORM_MATRIX
A ‘matrix(…)’ transformation.
[DOMName("SVG_TRANSFORM_MATRIX")]
public const ushort SVG_TRANSFORM_MATRIX = 1
Field Value
SVG_TRANSFORM_ROTATE
A ‘rotate(…)’ transformation.
[DOMName("SVG_TRANSFORM_ROTATE")]
public const ushort SVG_TRANSFORM_ROTATE = 4
Field Value
SVG_TRANSFORM_SCALE
A ‘scale(…)’ transformation.
[DOMName("SVG_TRANSFORM_SCALE")]
public const ushort SVG_TRANSFORM_SCALE = 3
Field Value
SVG_TRANSFORM_SKEWX
A ‘skewX(…)’ transformation.
[DOMName("SVG_TRANSFORM_SKEWX")]
public const ushort SVG_TRANSFORM_SKEWX = 5
Field Value
SVG_TRANSFORM_SKEWY
A ‘skewY(…)’ transformation.
[DOMName("SVG_TRANSFORM_SKEWY")]
public const ushort SVG_TRANSFORM_SKEWY = 6
Field Value
SVG_TRANSFORM_TRANSLATE
A ’translate(…)’ transformation.
[DOMName("SVG_TRANSFORM_TRANSLATE")]
public const ushort SVG_TRANSFORM_TRANSLATE = 2
Field Value
SVG_TRANSFORM_UNKNOWN
The unit type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
[DOMName("SVG_TRANSFORM_UNKNOWN")]
public const ushort SVG_TRANSFORM_UNKNOWN = 0
Field Value
Properties
Angle
A convenience attribute for SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY. It holds the angle that was specified. For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero.
[DOMName("angle")]
public float Angle { get; }
Property Value
Matrix
The matrix that represents this transformation. The matrix object is live, meaning that any changes made to the SVGTransform object are immediately reflected in the matrix object and vice versa. 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. For SVG_TRANSFORM_MATRIX, the matrix contains the a, b, c, d, e, f values supplied by the user. For SVG_TRANSFORM_TRANSLATE, e and f represent the translation amounts(a= 1, b= 0, c= 0 and d = 1). For SVG_TRANSFORM_SCALE, a and d represent the scale amounts(b= 0, c= 0, e= 0 and f = 0). For SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY, a, b, c and d represent the matrix which will result in the given skew(e= 0 and f = 0). For SVG_TRANSFORM_ROTATE, a, b, c, d, e and f together represent the matrix which will result in the given rotation.When the rotation is around the center point(0, 0), e and f will be zero.
[DOMName("matrix")]
public SVGMatrix Matrix { get; }
Property Value
Type
The type of the value as specified by one of the SVG_TRANSFORM_* constants defined on this interface.
[DOMName("type")]
public ushort Type { get; }
Property Value
Methods
SetMatrix(SVGMatrix)
Sets the transform type to SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation. The values from the parameter matrix are copied, the matrix parameter does not replace SVGTransform::matrix.
[DOMName("setMatrix")]
public void SetMatrix(SVGMatrix matrix)
Parameters
matrix
SVGMatrix
The new matrix for the transformation.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
SetRotate(float, float, float)
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.
[DOMName("setRotate")]
public void SetRotate(float angle, float cx, float cy)
Parameters
angle
float
The rotation angle.
cx
float
The x coordinate of center of rotation.
cy
float
The y coordinate of center of rotation.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
SetScale(float, float)
Sets the transform type to SVG_TRANSFORM_SCALE, with parameters sx and sy defining the scale amounts.
[DOMName("setScale")]
public void SetScale(float sx, float sy)
Parameters
sx
float
The scale amount in X.
sy
float
The scale amount in Y.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
SetSkewX(float)
Sets the transform type to SVG_TRANSFORM_SKEWX, with parameter angle defining the amount of skew.
[DOMName("setSkewX")]
public void SetSkewX(float angle)
Parameters
angle
float
The skew angle.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
SetSkewY(float)
Sets the transform type to SVG_TRANSFORM_SKEWY, with parameter angle defining the amount of skew.
[DOMName("setSkewY")]
public void SetSkewY(float angle)
Parameters
angle
float
The skew angle.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
SetTranslate(float, float)
Sets the transform type to SVG_TRANSFORM_TRANSLATE, with parameters tx and ty defining the translation amounts.
[DOMName("setTranslate")]
public void SetTranslate(float tx, float ty)
Parameters
tx
float
The translation amount in X.
ty
float
The translation amount in Y.
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
ToString()
Returns a System.String that represents this instance.
public override string ToString()
Returns
A System.String that represents this instance.