Search documentation of wx

# View Source wxGraphicsMatrix (wx v2.4.3)

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 `wxGraphicsContext:createMatrix/2` or `wxGraphicsRenderer:createMatrix/2`.

This class is derived, and can use functions, from:

- `wxGraphicsObject`

wxWidgets docs: wxGraphicsMatrix

# Summary

## Types

wxGraphicsMatrix()

## Functions

concat(This, T)

Concatenates the matrix passed with the current matrix.

get(This)

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

invert(This)

Inverts the matrix.

isEqual(This, T)

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

isIdentity(This)

Return true if this is the identity matrix.

rotate(This, Angle)

Rotates this matrix clockwise (in radians).

scale(This, XScale, YScale)

Scales this matrix.

set(This)

Equivalent to `set(This, [])`.

set/2

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

transformDistance(This)

Applies this matrix to a distance (ie.

transformPoint(This)

Applies this matrix to a point.

translate(This, Dx, Dy)

Translates this matrix.

# Types

Link to this type

# wxGraphicsMatrix()

View Source

    -type wxGraphicsMatrix() :: wx:wx_object().

# Functions

Link to this function

# concat(This, T)

View Source

    -spec concat(This, T) -> ok when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().

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.

Link to this function

# get(This)

View Source

    -spec get(This) -> Result
                 when
                     Result ::
                         {A :: number(),
                          B :: number(),
                          C :: number(),
                          D :: number(),
                          Tx :: number(),
                          Ty :: number()},
                     This :: wxGraphicsMatrix().

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

Link to this function

# invert(This)

View Source

    -spec invert(This) -> ok when This :: wxGraphicsMatrix().

Inverts the matrix.

Link to this function

# isEqual(This, T)

View Source

    -spec isEqual(This, T) -> boolean() when This :: wxGraphicsMatrix(), T :: wxGraphicsMatrix().

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

Link to this function

# isIdentity(This)

View Source

    -spec isIdentity(This) -> boolean() when This :: wxGraphicsMatrix().

Return true if this is the identity matrix.

Link to this function

# rotate(This, Angle)

View Source

    -spec rotate(This, Angle) -> ok when This :: wxGraphicsMatrix(), Angle :: number().

Rotates this matrix clockwise (in radians).

Link to this function

# scale(This, XScale, YScale)

View Source

    -spec scale(This, XScale, YScale) -> ok
                   when This :: wxGraphicsMatrix(), XScale :: number(), YScale :: number().

Scales this matrix.

Link to this function

# set(This)

View Source

    -spec set(This) -> ok when This :: wxGraphicsMatrix().

Equivalent to `set(This, [])`.

Link to this function

# set/2

View Source

    -spec set(This, [Option]) -> ok
                 when
                     This :: wxGraphicsMatrix(),
                     Option ::
                         {a, number()} |
                         {b, number()} |
                         {c, number()} |
                         {d, number()} |
                         {tx, number()} |
                         {ty, number()}.

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

Link to this function

# transformDistance(This)

View Source

    -spec transformDistance(This) -> {Dx :: number(), Dy :: number()} when This :: wxGraphicsMatrix().

Applies this matrix to a distance (ie.

performs all transforms except translations).

Link to this function

# transformPoint(This)

View Source

    -spec transformPoint(This) -> {X :: number(), Y :: number()} when This :: wxGraphicsMatrix().

Applies this matrix to a point.

Link to this function

# translate(This, Dx, Dy)

View Source

    -spec translate(This, Dx, Dy) -> ok when This :: wxGraphicsMatrix(), Dx :: number(), Dy :: number().

Translates this matrix.