CLASS RotImage EXTENDS Image (Defined in: jpgraph.php : 7238)

RotImage | Image
SetAngle() SetCenter() SetMargin() SetTranslation() | RoundedRectangle() SetAlphaBlending() SetAntiAliasing() SetCanvasColor() SetExpired() SetImgFormat() SetMargin() SetQuality() SetTransparent()

Class usage and Overview
A subclass of Image class which implements a rotated version of all methods in the base Image class. The Image class used in JpGraph is actually not the class Image but rather this class as we want to have the rotating possibility. The rotation is accomplished by standard 2D rotation matrices.

See also related classes:
Image

Class Methods

function SetAngle($a)
Specify rotation angle

Argument | Default | Description
--- | --- | ---
$a |  | Angle in degrees

Description
Specify the rotation angle for the other graphic primitives in this class. The rotation is performed around point (0,0).
See also
RotImage::SetTranslation and RotImage::SetCenter

Example

$graph->img->SetAngle(45);

function SetCenter($dx,$dy)
Set rotation center

Argument | Default | Description
--- | --- | ---
$dx |  | Specify rotation center X
$dy |  | Specify rotation center Y

Description
Specify center of rotation. (0,0) is the upper left most point in the image. By default the rotation point is choosen as tjhe midpoint of the image when the RotImage class is initially created.
See also
RotImage::SetTranslation and RotImage::SetAngle

Example

$width=600; $height=400;
$graph = new Graph($width,$height);
$graph->img->SetMargin($leftm,$rightm,$topm,$bottomm);
$graph->SetAngle(20);
// Rotate graph around the plots (0,0) point, i.e
// where the graph axis intersect.
$graph->img->SetCenter($leftm,$height-($topm+$bottomm));

function SetMargin($lm,$rm,$tm,$bm)
Specify margin for plot

Argument | Default | Description
--- | --- | ---
$lm |  | Left margin
$rm |  | Right margin
$tm |  | Top margin
$bm |  | Bottom margin

Description
Specify the margin, i.e. the area on the side of the actual plot which is used for titles, labels, legends ans so on.

Example

$graph->img->SetMargin(30,30,50,20);

function SetTranslation($dx,$dy)
Specify translation (in pixels)

Argument | Default | Description
--- | --- | ---
$dx |  | Horizontal translation
$dy |  | Vertical translation

Description
The translation is applied after the rotation of the image.
See also
RotImage::SetCenter and RotImage::SetAngle

Example

$graph->img->SetTranslation(10,10)