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¶
Methods Summary¶
Concatenates the matrix passed with the current matrix. |
|
Returns the component values of the matrix via the argument pointers. |
|
Returns the native representation of the matrix. |
|
Inverts the matrix. |
|
Returns |
|
Return |
|
Rotates this matrix clockwise (in radians). |
|
Scales this matrix. |
|
Sets the matrix to the respective values (default values are the identity matrix). |
|
Applies this matrix to a distance (i.e., performs all transforms except translations). |
|
Applies this matrix to a point. |
|
Translates this matrix. |
Properties Summary¶
See |
Class API¶
- class wx.GraphicsMatrix(GraphicsObject)¶
A GraphicsMatrix is a native representation of an affine matrix.
Methods¶
- Concat(self, t)¶
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
CFAffineMatrixpointer, for GDI+ aMatrixPointer, and for Cairo acairo_matrix_tpointer.- Return type:
Any
- Invert(self)¶
Inverts the matrix.
- Return type:
None
- IsEqual(self, t)¶
Returns
Trueif the elements of the transformation matrix are equal.- Parameters:
- Return type:
bool
- IsIdentity(self)¶
Return
Trueif this is the identity matrix.- Return type:
bool
- Rotate(self, angle)¶
Rotates this matrix clockwise (in radians).
This can be useful for applying a tilt to your drawing commands or for drawing radial patterns.
- Parameters:
angle (wx.Double) – Rotation angle in radians, clockwise.
- Return type:
None
See also
DegToRad
- Scale(self, xScale, yScale)¶
Scales this matrix.
- Parameters:
xScale (wx.Double)
yScale (wx.Double)
- Return type:
None
- 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 (wx.Double)
b (wx.Double)
c (wx.Double)
d (wx.Double)
tx (wx.Double)
ty (wx.Double)
- Return type:
None
- TransformDistance(self, dx, dy)¶
Applies this matrix to a distance (i.e., performs all transforms except translations).
- Parameters:
dx (wx.Double)
dy (wx.Double)
- Return type:
Tuple[float, float]
- TransformPoint(self, x, y)¶
Applies this matrix to a point.
- Parameters:
x (wx.Double)
y (wx.Double)
- Return type:
Tuple[float, float]
- Translate(self, *args, **kw)¶
-
Translate (self, dx, dy)
Translates this matrix.
- Parameters:
dx (wx.Double)
dy (wx.Double)
- Return type:
None
Translate (self, pt)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters:
pt (wx.Point2D)
- Return type:
None
Added in version 4.3/wxWidgets-3.3.0.
Properties¶
- NativeMatrix¶
See
GetNativeMatrix
