|
PHP5中文手册
ps_translate(PECL ps:1.1.0-1.3.5) ps_translate — Sets translation 说明
bool ps_translate
( resource $psdoc
, float $x
, float $y
)
Sets a new initial point of the coordinate system. 参数
返回值如果成功则返回 TRUE,失败则返回 FALSE。 范例
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 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. |