C# Class Eto.Drawing.Matrix

Methods to create and manage an IMatrix
Datei anzeigen Open project: picoe/Eto

Public Methods

Method Description
Append ( this matrix ) : void

Append the specified matrices to the matrix

Create ( ) : IMatrix

Creates a new identity matrix

Create ( float elements ) : IMatrix

Creates a new matrix with the specified elements

Create ( float xx, float yx, float xy, float yy, float x0, float y0 ) : IMatrix

Creates a new matrix with the specified components

FromRotation ( float angle ) : IMatrix

Creates a new rotation matrix

FromRotationAt ( float angle, Eto.Drawing.PointF center ) : IMatrix

Creates a new rotation matrix around a center point with the specified angle

FromRotationAt ( float angle, float centerX, float centerY ) : IMatrix

Creates a new rotation matrix around a (centerX, centerY) point with the specified angle

FromScale ( Eto.Drawing.SizeF scale ) : IMatrix

Creates a new matrix with the specified scale

FromScale ( float scaleX, float scaleY ) : IMatrix

Creates a new matrix with the specified scale factor

FromScaleAt ( Eto.Drawing.SizeF scale, Eto.Drawing.PointF center ) : IMatrix

Creates a new matrix with a scale at the specified center point

FromScaleAt ( float scaleX, float scaleY, float centerX, float centerY ) : IMatrix

Creates a new matrix with a scale at the specified point

FromSkew ( float skewX, float skewY ) : IMatrix

Creates a new matrix with a skew

FromTranslation ( Eto.Drawing.PointF offset ) : IMatrix

Creates a new matrix with a translation

FromTranslation ( Eto.Drawing.SizeF offset ) : IMatrix

Creates a new matrix with a translation

FromTranslation ( float distanceX, float distanceY ) : IMatrix

Creates a new matrix with a translation

GetScale ( this matrix ) : Eto.Drawing.PointF

Returns the scale coordinates Xx and Yy of the matrix as a PointF.

Inverse ( this matrix ) : IMatrix

Creates an inverted copy of the specified matrix.

Multiply ( IMatrix matrix ) : IMatrix

Multiply the specified matrix and matrices.

Prepend ( this matrix ) : void

Prepends the specified matrices to the matrix

RotateAt ( this matrix, float angle, Eto.Drawing.PointF center ) : void

Prepend a rotation around the specified point to the matrix

Scale ( this matrix, Eto.Drawing.SizeF scale ) : void

Prepend a scale to the matrix from the origin (0, 0)

Scale ( this matrix, float scale ) : void

Prepend a scale to the matrix from the origin (0, 0)

ScaleAt ( this matrix, Eto.Drawing.SizeF scale, Eto.Drawing.PointF center ) : void

Prepend a scale to the matrix from the specified point

ScaleAt ( this matrix, float scale, Eto.Drawing.PointF center ) : void

Prepend a scale to the matrix from the specified point

ScaleAt ( this matrix, float scale, float centerX, float centerY ) : void

Prepend a scale to the matrix from the specified point

TransformRectangle ( this matrix, Eto.Drawing.RectangleF rect ) : Eto.Drawing.RectangleF

Transforms the rectangle with the current matrix.

This returns a rectangle that encompasses the specified rect after it is translated. When rotating, this means that the new rectangle may be larger in size to encompass the translated rectangle.

TransformSize ( this matrix, Eto.Drawing.SizeF size ) : Eto.Drawing.SizeF

Transforms the size with the current matrix.

This will get the transformed size

Translate ( this matrix, Eto.Drawing.PointF offset ) : void

Prepend a translation to the matrix

Translate ( this matrix, Eto.Drawing.SizeF offset ) : void

Prepend a translation to the matrix

Method Details

Append() public static method

Append the specified matrices to the matrix
public static Append ( this matrix ) : void
matrix this Matrix to append to
return void

Create() public static method

Creates a new identity matrix
public static Create ( ) : IMatrix
return IMatrix

Create() public static method

Creates a new matrix with the specified elements
public static Create ( float elements ) : IMatrix
elements float Elements of the matrix (six components)
return IMatrix

Create() public static method

Creates a new matrix with the specified components
public static Create ( float xx, float yx, float xy, float yy, float x0, float y0 ) : IMatrix
xx float Xx component of the matrix
yx float Yx component of the matrix
xy float Xy component of the matrix
yy float Yy component of the matrix
x0 float X0 component of the matrix
y0 float Y0 component of the matrix
return IMatrix

FromRotation() public static method

Creates a new rotation matrix
public static FromRotation ( float angle ) : IMatrix
angle float Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise
return IMatrix

FromRotationAt() public static method

Creates a new rotation matrix around a center point with the specified angle
public static FromRotationAt ( float angle, Eto.Drawing.PointF center ) : IMatrix
angle float Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise
center Eto.Drawing.PointF the point to rotate around
return IMatrix

FromRotationAt() public static method

Creates a new rotation matrix around a (centerX, centerY) point with the specified angle
public static FromRotationAt ( float angle, float centerX, float centerY ) : IMatrix
angle float Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise
centerX float X co-ordinate of the point to rotate around
centerY float Y co-ordinate of the point to rotate around
return IMatrix

FromScale() public static method

Creates a new matrix with the specified scale
public static FromScale ( Eto.Drawing.SizeF scale ) : IMatrix
scale Eto.Drawing.SizeF Scale size for the X and Y coordinates
return IMatrix

FromScale() public static method

Creates a new matrix with the specified scale factor
public static FromScale ( float scaleX, float scaleY ) : IMatrix
scaleX float The amount to multiply coordinates along the x axis
scaleY float The amount to multiply coordinates along the y axis
return IMatrix

FromScaleAt() public static method

Creates a new matrix with a scale at the specified center point
public static FromScaleAt ( Eto.Drawing.SizeF scale, Eto.Drawing.PointF center ) : IMatrix
scale Eto.Drawing.SizeF The amount to multiply coordinates by
center Eto.Drawing.PointF Point to scale from
return IMatrix

FromScaleAt() public static method

Creates a new matrix with a scale at the specified point
public static FromScaleAt ( float scaleX, float scaleY, float centerX, float centerY ) : IMatrix
scaleX float The amount to multiply coordinates along the x axis
scaleY float The amount to multiply coordinates along the y axis
centerX float X co-ordinate of the point to scale from
centerY float Y co-ordinate of the point to scale from
return IMatrix

FromSkew() public static method

Creates a new matrix with a skew
public static FromSkew ( float skewX, float skewY ) : IMatrix
skewX float Amount to skew along the X axis, 1.0 does not skew
skewY float Amount to skew along the Y axis, 1.0 does not skew
return IMatrix

FromTranslation() public static method

Creates a new matrix with a translation
public static FromTranslation ( Eto.Drawing.PointF offset ) : IMatrix
offset Eto.Drawing.PointF Offset to translate by
return IMatrix

FromTranslation() public static method

Creates a new matrix with a translation
public static FromTranslation ( Eto.Drawing.SizeF offset ) : IMatrix
offset Eto.Drawing.SizeF Offset to translate by
return IMatrix

FromTranslation() public static method

Creates a new matrix with a translation
public static FromTranslation ( float distanceX, float distanceY ) : IMatrix
distanceX float Distance to translate along the x axis
distanceY float Distance to translate along the y axis
return IMatrix

GetScale() public static method

Returns the scale coordinates Xx and Yy of the matrix as a PointF.
public static GetScale ( this matrix ) : Eto.Drawing.PointF
matrix this
return Eto.Drawing.PointF

Inverse() public static method

Creates an inverted copy of the specified matrix.
public static Inverse ( this matrix ) : IMatrix
matrix this Matrix to invert.
return IMatrix

Multiply() public static method

Multiply the specified matrix and matrices.
public static Multiply ( IMatrix matrix ) : IMatrix
matrix IMatrix Matrix to multiply with
return IMatrix

Prepend() public static method

Prepends the specified matrices to the matrix
public static Prepend ( this matrix ) : void
matrix this Matrix to prepend to
return void

RotateAt() public static method

Prepend a rotation around the specified point to the matrix
public static RotateAt ( this matrix, float angle, Eto.Drawing.PointF center ) : void
matrix this Matrix to rotate
angle float Angle in degrees to rotate. A positive value indicates a clockwise rotation, whereas a negative value will rotate counter clockwise
center Eto.Drawing.PointF Point to rotate around
return void

Scale() public static method

Prepend a scale to the matrix from the origin (0, 0)
public static Scale ( this matrix, Eto.Drawing.SizeF scale ) : void
matrix this Matrix to scale
scale Eto.Drawing.SizeF The amount to multiply coordinates
return void

Scale() public static method

Prepend a scale to the matrix from the origin (0, 0)
public static Scale ( this matrix, float scale ) : void
matrix this Matrix to scale
scale float The amount to multiply coordinates along both the x and y axis
return void

ScaleAt() public static method

Prepend a scale to the matrix from the specified point
public static ScaleAt ( this matrix, Eto.Drawing.SizeF scale, Eto.Drawing.PointF center ) : void
matrix this Matrix to scale
scale Eto.Drawing.SizeF The amount to multiply coordinates
center Eto.Drawing.PointF Point to scale from
return void

ScaleAt() public static method

Prepend a scale to the matrix from the specified point
public static ScaleAt ( this matrix, float scale, Eto.Drawing.PointF center ) : void
matrix this Matrix to scale
scale float The amount to multiply coordinates along both the x and y axis
center Eto.Drawing.PointF Point to scale from
return void

ScaleAt() public static method

Prepend a scale to the matrix from the specified point
public static ScaleAt ( this matrix, float scale, float centerX, float centerY ) : void
matrix this Matrix to scale
scale float The amount to multiply coordinates along both the x and y axis
centerX float X co-ordinate of the point to scale from
centerY float Y co-ordinate of the point to scale from
return void

TransformRectangle() public static method

Transforms the rectangle with the current matrix.
This returns a rectangle that encompasses the specified rect after it is translated. When rotating, this means that the new rectangle may be larger in size to encompass the translated rectangle.
public static TransformRectangle ( this matrix, Eto.Drawing.RectangleF rect ) : Eto.Drawing.RectangleF
matrix this Matrix to transform each point of the rectangle.
rect Eto.Drawing.RectangleF Rectangle to transform.
return Eto.Drawing.RectangleF

TransformSize() public static method

Transforms the size with the current matrix.
This will get the transformed size
public static TransformSize ( this matrix, Eto.Drawing.SizeF size ) : Eto.Drawing.SizeF
matrix this
size Eto.Drawing.SizeF
return Eto.Drawing.SizeF

Translate() public static method

Prepend a translation to the matrix
public static Translate ( this matrix, Eto.Drawing.PointF offset ) : void
matrix this Matrix to translate
offset Eto.Drawing.PointF The amount to offset
return void

Translate() public static method

Prepend a translation to the matrix
public static Translate ( this matrix, Eto.Drawing.SizeF offset ) : void
matrix this Matrix to translate
offset Eto.Drawing.SizeF The amount to offset
return void