Exemple #1
0
function frame($psdoc)
{
    ps_setlinewidth($psdoc, 60);
    ps_moveto($psdoc, 150, 50);
    ps_lineto($psdoc, 750, 50);
    ps_arc($psdoc, 750, 150, 100, 270, 360);
    ps_lineto($psdoc, 850, 750);
    ps_arc($psdoc, 750, 750, 100, 0, 90);
    ps_lineto($psdoc, 150, 850);
    ps_arc($psdoc, 150, 750, 100, 90, 180);
    ps_lineto($psdoc, 50, 150);
    ps_arc($psdoc, 150, 150, 100, 180, 270);
    ps_stroke($psdoc);
}
Exemple #2
0
 function drawPie($centerX, $centerY, $radius, $begin, $end, $style)
 {
     $this->_convertPosition($centerX, $centerY);
     $radius = $radius * min($this->width, $this->height);
     ps_setcolor($this->ps, 'stroke', $style['line'][0], $style['line'][1], $style['line'][2], $style['line'][3], $style['line'][4]);
     if (isset($style['fill'])) {
         ps_setcolor($this->ps, 'fill', $style['fill'][0], $style['fill'][1], $style['fill'][2], $style['fill'][3], $style['fill'][4]);
     }
     ps_setlinewidth($this->ps, $style['line-width']);
     ps_moveto($this->ps, $centerX, $centerY);
     ps_arc($this->ps, $centerX, $centerY, $radius, $begin, $end);
     ps_lineto($this->ps, $centerX, $centerY);
     ps_closepath($this->ps);
     if (isset($style['fill'])) {
         ps_fill_stroke($this->ps);
     } else {
         ps_stroke($this->ps);
     }
 }
Exemple #3
0
     end_example_box($ps);
 }
 if (isset($_REQUEST['box10']) && $_REQUEST['box10'] == "true") {
     if ($x > 3) {
         $y -= 150;
         $x = 0;
     }
     begin_example_box($ps, LEFT_BORDER + (EXAMPLE_BOX_WIDTH + 30) * $x++, $y, "Path (2)", $psfont);
     ps_moveto($ps, 10, 10);
     ps_lineto($ps, 20, 20);
     ps_rect($ps, 30, 30, 10, 20);
     ps_lineto($ps, 50, 10);
     ps_stroke($ps);
     ps_moveto($ps, 70, 10);
     ps_lineto($ps, 70, 50);
     ps_arc($ps, 70, 60, 20, 60, 210);
     ps_stroke($ps);
     end_example_box($ps);
 }
 if (isset($_REQUEST['box11']) && $_REQUEST['box11'] == "true") {
     if ($x > 3) {
         $y -= 150;
         $x = 0;
     }
     begin_example_box($ps, LEFT_BORDER + (EXAMPLE_BOX_WIDTH + 30) * $x++, $y, "Text", $psfont);
     ps_setfont($ps, $psfont, 8.0);
     ps_show_xy($ps, "This is text in 8.0", 10, 10);
     ps_setfont($ps, $psfont, 12.0);
     ps_show_xy($ps, "and in 12.0", 10, 23);
     ps_setfont($ps, $psfont, 18.0);
     ps_show_xy($ps, "in 18.0", 10, 40);