PHP » GoLang |
login |
register |
about
|
ps_translate(PECL ps >= 1.1.0) ps_translate — Sets translation Description
bool ps_translate
( resource
$psdoc
, float $x
, float $y
)Sets a new initial point of the coordinate system. Parameters
Return Values
Returns Examples
Example #1 Translation of the coordinate system
<?php The above example demonstrates two possible ways to place a graphic (in this case just a rectangle) at any position on the page, while the graphic itself uses its own coordinate system. The trick is to change the origin of the current coordinate system before drawing the rectangle. The translation has to be undone after the graphic has been drawn. On the second page a slightly different and more elegant approach is applied. Instead of undoing the translation with a second call of ps_translate() the graphics context is saved before modifying the coordinate system and restored after drawing the rectangle. |
more
Recently updated
more
Most requested
more
Last requests
|