Table Of Contents

Previous topic

GraphicsGradientStops

Next topic

GraphicsObject

This Page

phoenix_title GraphicsMatrix

A GraphicsMatrix is a native representation of an affine matrix.

The contents are specific and private to the respective renderer. Instances are ref counted and can therefore be assigned as usual. The only way to get a valid instance is via GraphicsContext.CreateMatrix or GraphicsRenderer.CreateMatrix .


class_hierarchy Inheritance Diagram

Inheritance diagram for class GraphicsMatrix

Inheritance diagram of GraphicsMatrix


method_summary Methods Summary

Concat Concatenates the matrix passed with the current matrix.
Get Returns the component values of the matrix via the argument pointers.
GetNativeMatrix Returns the native representation of the matrix.
Invert Inverts the matrix.
IsEqual Returns True if the elements of the transformation matrix are equal.
IsIdentity Return True if this is the identity matrix.
Rotate Rotates this matrix clockwise (in radians).
Scale Scales this matrix.
Set Sets the matrix to the respective values (default values are the identity matrix).
TransformDistance Applies this matrix to a distance (ie.
TransformPoint Applies this matrix to a point.
Translate Translates this matrix.

property_summary Properties Summary

NativeMatrix See GetNativeMatrix

api Class API



class GraphicsMatrix(GraphicsObject)

A GraphicsMatrix is a native representation of an affine matrix.


Methods



Concat(self, t)

Concatenates the matrix passed with the current matrix.

Parameters:t (GraphicsMatrix) –


Get(self)

Returns the component values of the matrix via the argument pointers.

Return type:tuple
Returns:( a, b, c, d, tx, ty )


GetNativeMatrix(self)

Returns the native representation of the matrix.

For CoreGraphics this is a CFAffineMatrix pointer, for GDIPlus a Matrix Pointer, and for Cairo a cairo_matrix_t pointer.



Invert(self)

Inverts the matrix.



IsEqual(self, t)

Returns True if the elements of the transformation matrix are equal.

Parameters:t (GraphicsMatrix) –
Return type:bool


IsIdentity(self)

Return True if this is the identity matrix.

Return type:bool


Rotate(self, angle)

Rotates this matrix clockwise (in radians).

Parameters:angle (float) –

Rotation angle in radians, clockwise.



Scale(self, xScale, yScale)

Scales this matrix.

Parameters:
  • xScale (float) –
  • yScale (float) –


Set(self, a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0)

Sets the matrix to the respective values (default values are the identity matrix).

Parameters:
  • a (float) –
  • b (float) –
  • c (float) –
  • d (float) –
  • tx (float) –
  • ty (float) –


TransformDistance(self, dx, dy)

Applies this matrix to a distance (ie.

performs all transforms except translations).

Parameters:
  • dx (float) –
  • dy (float) –
Return type:

tuple

Returns:

( dx, dy )



TransformPoint(self, x, y)

Applies this matrix to a point.

Parameters:
  • x (float) –
  • y (float) –
Return type:

tuple

Returns:

( x, y )



Translate(self, dx, dy)

Translates this matrix.

Parameters:
  • dx (float) –
  • dy (float) –

Properties



NativeMatrix

See GetNativeMatrix