コード例 #1
0
ファイル: ps.php プロジェクト: railfuture/tiki-website
 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);
     }
 }
コード例 #2
0
ファイル: psclock.php プロジェクト: promoso/HVAC
 ps_restore($ps);
 ps_save($ps);
 ps_rotate($ps, -($ltime['minutes'] / 60.0 + $ltime['hours'] - 3.0) * 30.0);
 ps_moveto($ps, -$radius / 10, -$radius / 20);
 ps_lineto($ps, $radius / 2, 0.0);
 ps_lineto($ps, -$radius / 10, $radius / 20);
 ps_closepath($ps);
 ps_fill($ps);
 ps_restore($ps);
 /* draw minute hand */
 ps_save($ps);
 ps_rotate($ps, -($ltime['seconds'] / 60.0 + $ltime['minutes'] - 15.0) * 6.0);
 ps_moveto($ps, -$radius / 10, -$radius / 20);
 ps_lineto($ps, $radius * 0.8, 0.0);
 ps_lineto($ps, -$radius / 10, $radius / 20);
 ps_closepath($ps);
 ps_fill($ps);
 ps_restore($ps);
 /* draw second hand */
 //    ps_setrgbcolor($ps, 1.0, 0.0, 0.0);
 ps_setlinewidth($ps, 2);
 ps_save($ps);
 ps_rotate($ps, -(($ltime['seconds'] - 15.0) * 6.0));
 ps_moveto($ps, -$radius / 5, 0.0);
 ps_lineto($ps, $radius, 0.0);
 ps_stroke($ps);
 ps_restore($ps);
 /* draw little circle at center */
 ps_circle($ps, 0, 0, $radius / 30);
 ps_fill($ps);
 ps_end_page($ps);