Contents Up Previous Next

wxGraphicsMatrix

A wxGraphicsMatrix 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 a CreateMatrix call on the graphics context or the renderer instance.

Derived from

wxGraphicsObject

Include files

<wx/graphics.h>

Members

wxGraphicsMatrix::Concat
wxGraphicsMatrix::Get
wxGraphicsMatrix::GetNativeMatrix
wxGraphicsMatrix::Invert
wxGraphicsMatrix::IsEqual
wxGraphicsMatrix::IsIdentity
wxGraphicsMatrix::Rotate
wxGraphicsMatrix::Scale
wxGraphicsMatrix::Translate
wxGraphicsMatrix::Set
wxGraphicsMatrix::TransformPoint
wxGraphicsMatrix::TransformDistance


wxGraphicsMatrix::Concat

void Concat(const wxGraphicsMatrix* t)

Concatenates the matrix passed with the current matrix.

void Concat(const wxGraphicsMatrix& t)


wxGraphicsMatrix::Get

void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL, wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const

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


wxGraphicsMatrix::GetNativeMatrix

void * GetNativeMatrix() const

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.


wxGraphicsMatrix::Invert

void Invert()

Inverts the matrix.


wxGraphicsMatrix::IsEqual

bool IsEqual(const wxGraphicsMatrix& t) const

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


wxGraphicsMatrix::IsIdentity

bool IsIdentity() const

Return true if this is the identity matrix.


wxGraphicsMatrix::Rotate

void Rotate(wxDouble angle)

Rotates this matrix (radians).


wxGraphicsMatrix::Scale

void Scale(wxDouble xScale, wxDouble yScale)

Scales this matrix.


wxGraphicsMatrix::Translate

void Translate(wxDouble dx, wxDouble dy)

Translates this matrix.


wxGraphicsMatrix::Set

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

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


wxGraphicsMatrix::TransformPoint

void TransformPoint(wxDouble* x, wxDouble* y) const

Applies this matrix to a point.


wxGraphicsMatrix::TransformDistance

void TransformDistance(wxDouble* dx, wxDouble* dy) const

Applies this matrix to a distance (ie. performs all transforms except translations)