TransformBrush(id, sx, rx, ry, sy[, smooth])
TransformBrush()instead, everything will be done in a single run.
The 2x2 transformation matrix consists of four floating point factors:
The identity matrix is defined as
( 1 0 ) ( 0 1 )
If you pass this matrix, then no transformation will be applied because
there is no rotation and no scaling defined. I.e. if Hollywood applied
this matrix to every pixel in your brush, the result would be just a copy
of the brush. But of course, if
TransformBrush() detects that you passed
an identity matrix, it will return immediately and do nothing.
The optional argument
smooth can be set to
True if Hollywood shall use
interpolation during the transformation. This yields results that look
better but interpolation is quite slow.
Please note: You should always do transformation operations using the original brush. For instance, if you transform brush 1 to 12x8 pixels and then transform it back to 640x480, you will get a messed image. Therefore you should always keep the original brush and transform only copies of it.
Note that for vector brushes,
TransformBrush() will always operate on
the untransformed brush. This means that any previous transformations
applied to the brush using
or RotateBrush() will be undone when calling
angle = Rad(45) ; convert degrees to radians TransformBrush(1, Cos(angle), Sin(angle), -Sin(angle), Cos(angle))The code above rotates brush number 1 by 45 degrees using a 2x2 transformation matrix.