Exemple #1
0
 /**
  * Draws an arc.
  *
  * @param integer $x      The x co-ordinate of the centre.
  * @param integer $y      The y co-ordinate of the centre.
  * @param integer $r      The radius of the arc.
  * @param integer $start  The start angle of the arc.
  * @param integer $end    The end angle of the arc.
  * @param string $color   The line color of the arc.
  * @param string $fill    The fill color of the arc.
  */
 public function arc($x, $y, $r, $start, $end, $color = 'black', $fill = 'none')
 {
     $s = new SWFShape();
     $color = $this->allocateColor($color);
     $s->setLine(1, $color['red'], $color['green'], $color['blue'], $color['alpha']);
     if ($fill != 'none') {
         $fillColor = $this->allocateColor($fill);
         $s->setRightFill($fillColor['red'], $fillColor['green'], $fillColor['blue'], $fillColor['alpha']);
     }
     $pts = Horde_Image::arcPoints($r, $start, $end);
     $s->movePenTo($x, $y);
     $s->drawArc($r, $start + 90, $end + 90);
     $s->movePenTo($x, $y);
     $s->drawLineTo(round($pts['x1']) + $x, round($pts['y1']) + $y);
     $s->movePenTo($x, $y);
     $s->drawLineTo(round($pts['x2']) + $x, round($pts['y2']) + $y);
     $this->_movie->add($s);
 }