Query: ps_rotate
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PS_ROTATE(3) 1 PS_ROTATE(3) ps_rotate - Sets rotation factorSYNOPSISbool ps_rotate (resource $psdoc, float $rot)DESCRIPTIONSets the rotation of the coordinate system.PARAMETERSo $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $rot - Angle of rotation in degree.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 Rotation of the coordinate system <?php function rectangle($ps) { ps_moveto($ps, 0, 0); ps_lineto($ps, 0, 50); ps_lineto($ps, 50, 50); ps_lineto($ps, 50, 0); ps_lineto($ps, 0, 0); ps_stroke($ps); } $ps = ps_new(); if (!ps_open_file($ps, "rotation.ps")) { print "Cannot open PostScript file "; exit; } ps_set_info($ps, "Creator", "rotation.php"); ps_set_info($ps, "Author", "Uwe Steinmann"); ps_set_info($ps, "Title", "Rotation example"); ps_set_info($ps, "BoundingBox", "0 0 596 842"); $psfont = ps_findfont($ps, "Helvetica", "", 0); ps_begin_page($ps, 596, 842); ps_set_text_pos($ps, 100, 100); ps_save($ps); ps_translate($ps, 100, 100); ps_rotate($ps, 45); rectangle($ps); ps_restore($ps); ps_setfont($ps, $psfont, 8.0); ps_show($ps, "Text without rotation"); ps_end_page($ps); ps_delete($ps); ?> The above example illustrates a very common way of rotating a graphic (in this case just a rectangle) by simply rotating the coor- dinate system. Since the graphic's coordinate system assumes (0,0) to be the origin, the page coordinate system is also translated to place the graphics not on the edge of the page. Pay attention to the order of ps_translate(3) and ps_rotate(3). In the above case the rectancle is rotated around the point (100, 100) in the untranslated coordinate system. Switching the two statements has a com- pletely different result. In order to output the following text at the original position, all modifications of the coordinate system are encapsulated in ps_save(3) and ps_restore(3).SEE ALSOps_scale(3), ps_translate(3). PHP Documentation Group PS_ROTATE(3)
Related Man Pages |
---|
imagecopymergegray(3) - php |
imagedashedline(3) - php |
ps_makespotcolor(3) - php |
ps_rotate(3) - php |
ps_translate(3) - php |
Similar Topics in the Unix Linux Community |
---|
USN-842-1: Wget vulnerability |
Log Rotation |