当前位置: 首页>>代码示例>>PHP>>正文


PHP Image_Canvas::rectangle方法代码示例

本文整理汇总了PHP中Image_Canvas::rectangle方法的典型用法代码示例。如果您正苦于以下问题:PHP Image_Canvas::rectangle方法的具体用法?PHP Image_Canvas::rectangle怎么用?PHP Image_Canvas::rectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Image_Canvas的用法示例。


在下文中一共展示了Image_Canvas::rectangle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rectangle

 /**
  * Draw a rectangle
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function rectangle($params)
 {
     if (isset($this->_imageMap)) {
         $this->_imageMap->rectangle($params);
     }
     parent::rectangle($params);
 }
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:19,代码来源:WithMap.php

示例2: rectangle

 /**
  * Draw a rectangle
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function rectangle($params)
 {
     $x0 = $this->_getX($params['x0']);
     $y0 = $this->_getY($params['y0']);
     $x1 = $this->_getX($params['x1']);
     $y1 = $this->_getY($params['y1']);
     $fillColor = isset($params['fill']) ? $params['line'] : false;
     $lineColor = isset($params['line']) ? $params['line'] : false;
     $line = $this->_setLineStyle($lineColor);
     $fill = $this->_setFillStyle($fillColor);
     if ($line || $fill) {
         pdf_rect($this->_pdf, $this->_getX(min($x0, $x1)), $this->_getY(max($y0, $y1)), abs($x1 - $x0), abs($y1 - $y0));
         if ($line && $fill) {
             pdf_fill_stroke($this->_pdf);
         } elseif ($line) {
             pdf_stroke($this->_pdf);
         } elseif ($fill) {
             pdf_fill($this->_pdf);
         }
     }
     parent::rectangle($params);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:34,代码来源:PDF.php

示例3: rectangle

 /**
  * Draw a rectangle
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function rectangle($params)
 {
     if (isset($params['url'])) {
         $this->_addMapTag('rect', $this->_getX($params['x0']) . ',' . $this->_getY($params['y0']) . ',' . $this->_getX($params['x1']) . ',' . $this->_getY($params['y1']), $params);
     }
     parent::rectangle($params);
 }
开发者ID:villos,项目名称:tree_admin,代码行数:19,代码来源:ImageMap.php

示例4: rectangle

 /**
  * Draw a rectangle
  *
  * Parameter array:
  * 'x0': int X start point
  * 'y0': int Y start point
  * 'x1': int X end point
  * 'y1': int Y end point
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function rectangle($params)
 {
     $x0 = min($this->_getX($params['x0']), $this->_getX($params['x1']));
     $y0 = min($this->_getY($params['y0']), $this->_getY($params['y1']));
     $x1 = max($this->_getX($params['x0']), $this->_getX($params['x1']));
     $y1 = max($this->_getY($params['y0']), $this->_getY($params['y1']));
     $fillColor = isset($params['fill']) ? $params['line'] : false;
     $lineColor = isset($params['line']) ? $params['line'] : false;
     $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
     if ($style != '') {
         $this->_addElement('<rect ' . 'x="' . round($x0) . '" ' . 'y="' . round($y0) . '" ' . 'width="' . round(abs($x1 - $x0)) . '" ' . 'height="' . round(abs($y1 - $y0)) . '" ' . 'style="' . $style . '"' . '/>', $params);
     }
     parent::rectangle($params);
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:26,代码来源:SVG.php

示例5: rectangle

 /**
  * Draw a rectangle
  *
  * Parameter array:
  * 'x0'   : int X start point
  * 'y0'   : int Y start point
  * 'x1'   : int X end point
  * 'y1'   : int Y end point
  * 'fill' : The fill style
  * 'line' : The line style
  * 'url'  : string [optional] Target URL
  *
  * @param array $params Parameter array
  *
  * @return void
  */
 function rectangle($params)
 {
     $x0 = min($this->_getX($params['x0']), $this->_getX($params['x1']));
     $y0 = min($this->_getY($params['y0']), $this->_getY($params['y1']));
     $x1 = max($this->_getX($params['x0']), $this->_getX($params['x1']));
     $y1 = max($this->_getY($params['y0']), $this->_getY($params['y1']));
     $fillColor = isset($params['fill']) ? $params['fill'] : false;
     $lineColor = isset($params['line']) ? $params['line'] : false;
     $fillColor = $this->_getFillStyle($fillColor);
     $lineColor = $this->_getLineStyle($lineColor);
     // use fill color if no line color is set or transparent
     if (count($lineColor) === 0) {
         $lineColor = $fillColor;
     }
     $shape = new SWFShape();
     $shape->setLine(1, $lineColor[0], $lineColor[1], $lineColor[2]);
     if (count($fillColor)) {
         $shape->setRightFill($fillColor[0], $fillColor[1], $fillColor[2]);
     }
     $shape->movePenTo($x0, $y0);
     $shape->drawLine($x1 - $x0, 0);
     $shape->drawLine(0, $y1 - $y0);
     $shape->drawLine($x0 - $x1, 0);
     $shape->drawLine(0, $y0 - $y1);
     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::rectangle($params);
 }
开发者ID:roojs,项目名称:pear,代码行数:50,代码来源:SWF.php


注:本文中的Image_Canvas::rectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。