Transformations
Informations
Authors: Moritz Wagner & Andreas Würmser
License: FPDF
Description
Performs the following 2D transformations: scaling, mirroring, translation, rotation and skewing.
Use StartTransform() before, and StopTransform() after the transformations to restore the
normal behavior.
StartTransform()
Use this before calling any tranformation.
ScaleX(float s_x [, float x [, float y]])
ScaleY(float s_y [, float x [, float y]])
ScaleXY(float s [, float x [, float y]])
Scale(float s_x, float s_y [, float x [, float y]])
s_x: scaling factor for width as percent. 0 is not allowed.
s_y: scaling factor for height as percent. 0 is not allowed.
s: scaling factor for width and height as percent. 0 is not allowed.
x: abscissa of the scaling center. Default is current x position
y: ordinate of the scaling center. Default is current y position
MirrorH([float x])
Alias for scaling -100% in x-direction
x: abscissa of the axis of reflection
MirrorV([float y])
Alias for scaling -100% in y-direction
y: ordinate of the axis of reflection
MirrorP([float x, [float y]])
Point reflection on point (x, y). (alias for scaling -100 in x- and y-direction)
x: abscissa of the point. Default is current x position
y: ordinate of the point. Default is current y position
MirrorL([float angle [, float x [, float y]]])
Reflection against a straight line through point (x, y) with the gradient angle (angle).
angle: gradient angle of the straight line. Default is 0 (horizontal line).
x: abscissa of the point. Default is current x position
y: ordinate of the point. Default is current y position
TranslateX(float t_x)
TranslateY(float t_y)
Translate(float t_x, float t_y)
t_x: movement to the right
t_y: movement to the bottom
Rotate(float angle [, float x [, float y]])
angle: angle in degrees for counter-clockwise rotation
x: abscissa of the rotation center. Default is current x position
y: ordinate of the rotation center. Default is current y position
SkewX(float angle_x [, float x [, float y]])
SkewY(float angle_y [, float x [, float y]])
Skew(float angle_x, float angle_y [, float x [, float y]])
angle_x: angle in degrees between -90 (skew to the left) and 90 (skew to the right)
angle_y: angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)
x: abscissa of the skewing center. default is current x position
y: ordinate of the skewing center. default is current y position
StopTransform()
Restores the normal painting and placing behavior as it was before calling StartTransform().