phoenix_title wx.GraphicsMatrix

A wx.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 wx.GraphicsContext.CreateMatrix or wx.GraphicsRenderer.CreateMatrix .


class_hierarchy Class Hierarchy

Inheritance diagram for class 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 wx.GraphicsMatrix(GraphicsObject)

A GraphicsMatrix is a native representation of an affine matrix.


Methods

Concat(self, t : GraphicsMatrix)

Concatenates the matrix passed with the current matrix.

The effect of the resulting transformation is to first apply the transformation in t to the coordinates and then apply the transformation in the current matrix to the coordinates.

# matrix = t * matrix
Parameters:

t (wx.GraphicsMatrix) – The parameter matrix is the multiplicand.

Return type:

None



Get(self)

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

Return type:

Tuple[float, float, float, float, float, float]



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.

Return type:

Any



Invert(self)

Inverts the matrix.

Return type:

None



IsEqual(self, t : GraphicsMatrix)

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

Parameters:

t (wx.GraphicsMatrix) –

Return type:

bool



IsIdentity(self)

Return True if this is the identity matrix.

Return type:

bool



Rotate(self, angle : float)

Rotates this matrix clockwise (in radians).

Parameters:

angle (wx.Double) – Rotation angle in radians, clockwise.

Return type:

None



Scale(self, xScale : float, yScale : float)

Scales this matrix.

Parameters:
  • xScale (wx.Double) –

  • yScale (wx.Double) –

Return type:

None



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

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

Parameters:
  • a (wx.Double) –

  • b (wx.Double) –

  • c (wx.Double) –

  • d (wx.Double) –

  • tx (wx.Double) –

  • ty (wx.Double) –

Return type:

None



TransformDistance(self, dx : float, dy : float)

Applies this matrix to a distance (ie.

performs all transforms except translations).

Parameters:
  • dx (wx.Double) –

  • dy (wx.Double) –

Return type:

Tuple[float, float]



TransformPoint(self, x : float, y : float)

Applies this matrix to a point.

Parameters:
  • x (wx.Double) –

  • y (wx.Double) –

Return type:

Tuple[float, float]



Translate(self, dx : float, dy : float)

Translates this matrix.

Parameters:
  • dx (wx.Double) –

  • dy (wx.Double) –

Return type:

None


Properties

NativeMatrix

See GetNativeMatrix