Android Guides | Samples

Android.Graphics.Matrix Class

The Matrix class holds a 3x3 matrix for transforming coordinates.

See Also: Matrix

Syntax

[Android.Runtime.Register("android/graphics/Matrix", DoNotGenerateAcw=true)]
public class Matrix : Object

Remarks

The Matrix class holds a 3x3 matrix for transforming coordinates.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Graphics.Matrix are listed below.

See Also: Object

Public Constructors

Create an identity matrix
Create a matrix that is a (deep) copy of src

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
Mpersp0Int32 (6).
const
Mpersp1Int32 (7).
const
Mpersp2Int32 (8).
const
MscaleXInt32 (0).
const
MscaleYInt32 (4).
const
MskewXInt32 (1).
const
MskewYInt32 (3).
const
MtransXInt32 (2).
const
MtransYInt32 (5).

Public Properties

[read-only]
IsAffineBoolean. Gets whether this matrix is affine.
[read-only]
IsIdentityBoolean. Returns true if the matrix is identity.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

GetValues(Single[])
Copy 9 values from the matrix into the array.
Invert(Matrix) : Boolean
If this matrix can be inverted, return true and if inverse is not null, set inverse to be the inverse of this matrix.
MapPoints(Single[])
Apply this matrix to the array of 2D points, and write the transformed points back into the array
MapPoints(Single[], Single[])
Apply this matrix to the array of 2D points specified by src, and write the transformed points into the array of points specified by dst.
MapPoints(Single[], Int32, Single[], Int32, Int32)
Apply this matrix to the array of 2D points specified by src, and write the transformed points into the array of points specified by dst.
MapRadius(Single) : Single
Return the mean radius of a circle after it has been mapped by this matrix.
MapRect(RectF) : Boolean
Apply this matrix to the rectangle, and write the transformed rectangle back into it.
MapRect(RectF, RectF) : Boolean
Apply this matrix to the src rectangle, and write the transformed rectangle into dst.
MapVectors(Single[])
Apply this matrix to the array of 2D vectors, and write the transformed vectors back into the array.
MapVectors(Single[], Single[])
Apply this matrix to the array of 2D vectors specified by src, and write the transformed vectors into the array of vectors specified by dst.
MapVectors(Single[], Int32, Single[], Int32, Int32)
Apply this matrix to the array of 2D vectors specified by src, and write the transformed vectors into the array of vectors specified by dst.
PostConcat(Matrix) : Boolean
Postconcats the matrix with the specified matrix.
PostRotate(Single) : Boolean
Postconcats the matrix with the specified rotation.
PostRotate(Single, Single, Single) : Boolean
Postconcats the matrix with the specified rotation.
PostScale(Single, Single) : Boolean
Postconcats the matrix with the specified scale.
PostScale(Single, Single, Single, Single) : Boolean
Postconcats the matrix with the specified scale.
PostSkew(Single, Single) : Boolean
Postconcats the matrix with the specified skew.
PostSkew(Single, Single, Single, Single) : Boolean
Postconcats the matrix with the specified skew.
PostTranslate(Single, Single) : Boolean
Postconcats the matrix with the specified translation.
PreConcat(Matrix) : Boolean
Preconcats the matrix with the specified matrix.
PreRotate(Single) : Boolean
Preconcats the matrix with the specified rotation.
PreRotate(Single, Single, Single) : Boolean
Preconcats the matrix with the specified rotation.
PreScale(Single, Single) : Boolean
Preconcats the matrix with the specified scale.
PreScale(Single, Single, Single, Single) : Boolean
Preconcats the matrix with the specified scale.
PreSkew(Single, Single) : Boolean
Preconcats the matrix with the specified skew.
PreSkew(Single, Single, Single, Single) : Boolean
Preconcats the matrix with the specified skew.
PreTranslate(Single, Single) : Boolean
Preconcats the matrix with the specified translation.
RectStaysRect() : Boolean
Returns true if will map a rectangle to another rectangle.
Reset()
Set the matrix to identity
Set(Matrix)
(deep) copy the src matrix into this matrix.
SetConcat(Matrix, Matrix) : Boolean
Set the matrix to the concatenation of the two specified matrices and return true.
SetPolyToPoly(Single[], Int32, Single[], Int32, Int32) : Boolean
Set the matrix such that the specified src points would map to the specified dst points.
SetRectToRect(RectF, RectF, Matrix+ScaleToFit) : Boolean
Set the matrix to the scale and translate values that map the source rectangle to the destination rectangle, returning true if the the result can be represented.
SetRotate(Single)
Set the matrix to rotate about (0,0) by the specified number of degrees.
SetRotate(Single, Single, Single)
Set the matrix to rotate by the specified number of degrees, with a pivot point at (px, py).
SetScale(Single, Single)
Set the matrix to scale by sx and sy.
SetScale(Single, Single, Single, Single)
Set the matrix to scale by sx and sy, with a pivot point at (px, py).
SetSinCos(Single, Single)
Set the matrix to rotate by the specified sine and cosine values.
SetSinCos(Single, Single, Single, Single)
Set the matrix to rotate by the specified sine and cosine values, with a pivot point at (px, py).
SetSkew(Single, Single)
Set the matrix to skew by sx and sy.
SetSkew(Single, Single, Single, Single)
Set the matrix to skew by sx and sy, with a pivot point at (px, py).
SetTranslate(Single, Single)
Set the matrix to translate by (dx, dy).
SetValues(Single[])
Copy 9 values from the array into the matrix.
ToShortString() : String