示例#1
0
 /**
  * Draw a line
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'color': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function line($params)
 {
     if (isset($this->_imageMap)) {
         $this->_imageMap->line($params);
     }
     parent::line($params);
 }
示例#2
0
 /**
  * Draw a line
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'color': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function line($params)
 {
     $color = isset($params['color']) ? $params['color'] : false;
     if ($this->_setLineStyle($color)) {
         pdf_moveto($this->_pdf, $this->_getX($params['x0']), $this->_getY($params['y0']));
         pdf_lineto($this->_pdf, $this->_getX($params['x1']), $this->_getY($params['x1']));
         pdf_stroke($this->_pdf);
     }
     parent::line($params);
 }
示例#3
0
 /**
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'color': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function line($params)
 {
     $x0 = $this->_getX($params['x0']);
     $y0 = $this->_getY($params['y0']);
     $x1 = $this->_getX($params['x1']);
     $y1 = $this->_getY($params['y1']);
     $color = isset($params['color']) ? $params['color'] : false;
     $style = $this->_getLineStyle($color) . $this->_getFillStyle('transparent');
     if ($style != '') {
         $this->_addElement('<line ' . 'x1="' . round($x0) . '" ' . 'y1="' . round($y0) . '" ' . 'x2="' . round($x1) . '" ' . 'y2="' . round($y1) . '" ' . 'style="' . $style . '"' . '/>', $params);
     }
     parent::line($params);
 }
示例#4
0
 /**
  * Draw a line
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'color': mixed [optional] The line color
  * 'mapsize': int [optional] The size of the image map (surrounding the line)
  * @param array $params Parameter array
  */
 function line($params)
 {
     if (isset($params['url'])) {
         $mapsize = isset($params['mapsize']) ? $params['mapsize'] : 2;
         $this->_addMapTag('polygon', $this->_getX($params['x0'] - $mapsize) . ',' . $this->_getY($params['y0'] - $mapsize) . ',' . $this->_getX($params['x1'] + $mapsize) . ',' . $this->_getY($params['y1'] - $mapsize) . ',' . $this->_getX($params['x1'] + $mapsize) . ',' . $this->_getY($params['y1'] + $mapsize) . ',' . $this->_getX($params['x0'] - $mapsize) . ',' . $this->_getY($params['y0'] + $mapsize), $params);
     }
     parent::line($params);
 }
示例#5
0
 /**
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'color': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function line($params)
 {
     $x0 = $this->_getX($params['x0']);
     $y0 = $this->_getY($params['y0']);
     $x1 = $this->_getX($params['x1']);
     $y1 = $this->_getY($params['y1']);
     $color = isset($params['color']) ? $params['color'] : false;
     $attrs = isset($params['attrs']) && is_array($params['attrs']) ? $this->_getAttributes($params['attrs']) : null;
     $style = $this->_getLineStyle($color) . $this->_getFillStyle('transparent');
     if ($style != '') {
         $this->_addElement('<line ' . 'x1="' . round($x0) . '" ' . 'y1="' . round($y0) . '" ' . 'x2="' . round($x1) . '" ' . 'y2="' . round($y1) . '" ' . 'style="' . $style . '"' . ($attrs ? ' ' . $attrs : '') . '/>', $params);
     }
     parent::line($params);
 }
示例#6
0
文件: SWF.php 项目: roojs/pear
 /**
  * Parameter array:
  * 'x0'    : int X start point
  * 'y0'    : int Y start point
  * 'x1'    : int X end point
  * 'y1'    : int Y end point
  * 'color' : mixed [optional] The line color
  * 'url'   : string [optional] Target URL
  *
  * @param array $params Parameter array
  *
  * @return void
  */
 function line($params)
 {
     $x0 = $this->_getX($params['x0']);
     $y0 = $this->_getY($params['y0']);
     $x1 = $this->_getX($params['x1']);
     $y1 = $this->_getY($params['y1']);
     $color = isset($params['color']) ? $params['color'] : false;
     $color = $this->_getLineStyle($color);
     $shape = new SWFShape();
     $shape->setLine(1, $color[0], $color[1], $color[2]);
     $shape->movePenTo($x0, $y0);
     $shape->drawLine($x1 - $x0, $y1 - $y0);
     if (isset($params['url'])) {
         $button = new SWFButton();
         $button->addShape($shape, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER);
         $button->addAction(new SWFAction("getURL('{$params['url']}');"), SWFBUTTON_MOUSEUP);
         $this->_canvas->add($button);
     } else {
         $this->_canvas->add($shape);
     }
     parent::line($params);
 }