Документация PHP


ps_restore

ps_save

PS

PHP Manual


ps_rotate

(PECL ps:1.1.0-1.3.5)

ps_rotate — Sets rotation factor

Описание

bool ps_rotate ( resource $psdoc , float $rot )

Sets the rotation of the coordinate system.

Список параметров

psdoc

Resource identifier of the postscript file as returned by ps_new().

rot

Angle of rotation in degree.

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Примеры

Пример #1 Rotation of the coordinate system

<?php
function rectangle($ps) {
    
ps_moveto($ps00);
    
ps_lineto($ps050);
    
ps_lineto($ps5050);
    
ps_lineto($ps500);
    
ps_lineto($ps00);
    
ps_stroke($ps);
}

$ps ps_new();
if (!
ps_open_file($ps"rotation.ps")) {
  print 
"Cannot open PostScript file\n";
  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($ps596842);
ps_set_text_pos($ps100100);
ps_save($ps);
ps_translate($ps100100);
ps_rotate($ps45);
rectangle($ps);
ps_restore($ps);
ps_setfont($ps$psfont8.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 coordinate 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() and ps_rotate(). In the above case the rectancle is rotated around the point (100, 100) in the untranslated coordinate system. Switching the two statements has a completely different result.

In order to output the following text at the original position, all modifications of the coordinate system are encapsulated in ps_save() and ps_restore().

Смотрите также


ps_restore

ps_save

PS

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…