GdiBrush(arg)
Object used for drawing as alternative for simple colour.
Can also be used to reuse brushes for drawing instead of creating them every time for any primitive drawing operation (if just a color is specified in the Draw/Fill methods, a brush is always created).
Created by gdi.Brush
Type: BrushType
WrapMode: BrushWrapMode
Wrap mode responsible for how the brush gradient or image is repeated when drawing
See BrushWrapMode
ApplyTransform(matrix)
Applies specified transformation matrix of 3x2 size to the current GdiBrush matrix.
Matrix3x2 helper class from the component/docs/Matrix.js will be useful
Parameters
| Name | Type | Description |
matrix | Float32Array | Array that presents 3x2 matrix for transformation (length = 6) |
GetTransform()
Gets GdiBrush current transformation matrix of 3x2 size (Float32Array(6))
Matrix3x2 helper class from the component/docs/Matrix.js will be useful
PopTransform()
Restores GdiBrush matrix from internal stack pushed previously by PushTransform.
PushTransform()
Saves current GdiBrush matrix in internal stack. To restore the matrix use PopTransform.
ResetTransform()
Resets current GdiBrush matrix to original identity matrix.
Rotate(angle, cx, cy)
Parameters
| Name | Type | Description |
angle | float | Angle of rotation in degrees |
cx = 0optional | number | Rotation center point x coord |
cy = 0optional | number | Rotation center point y coord |
Scale(sz, sy, cx, cy)
Parameters
| Name | Type | Description |
sx | float | The x-axis scale factor |
sy = 0optional | float | The y-axis scale factor. If zero sx will be used as sy |
cx = 0optional | number | Scale center point x coord |
cy = 0optional | number | Scale center point y coord |
SetTransform(matrix)
Replaces the current GdiBrush matrix with specified transformation matrix of 3x2 size.
Matrix3x2 helper class from the component/docs/Matrix.js will be useful
Parameters
| Name | Type | Description |
matrix | Float32Array | Array that presents 3x2 matrix for transformation (length = 6) |
Skew(angleX, angleY, cx, cy)
Parameters
| Name | Type | Description |
angleX | float | The x-axis skew angle, which is measured in degrees counterclockwise from the y-axis. |
angleY | float | The y-axis skew angle, which is measured in degrees clockwise from the x-axis. |
cx = 0optional | number | Skew center point x coord |
cy = 0optional | number | Skew center point y coord |
Translate(dx, dy)
Parameters
| Name | Type | Description |
dx | number | |
dy | number | |