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


PHP Image_Canvas::ellipse方法代码示例

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


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

示例1: ellipse

 /**
  * Draw an ellipse
  *
  * Parameter array:
  * 'x': int X center point
  * 'y': int Y center point
  * 'rx': int X radius
  * 'ry': int Y radius
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function ellipse($params)
 {
     if (isset($this->_imageMap)) {
         $this->_imageMap->ellipse($params);
     }
     parent::ellipse($params);
 }
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:19,代码来源:WithMap.php

示例2: ellipse

 /**
  * Draw an ellipse
  *
  * Parameter array:
  * 'x': int X center point
  * 'y': int Y center point
  * 'rx': int X radius
  * 'ry': int Y radius
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function ellipse($params)
 {
     $x = $this->_getX($params['x']);
     $y = $this->_getY($params['y']);
     $rx = $this->_getX($params['rx']);
     $ry = $this->_getY($params['ry']);
     $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) {
         if ($rx == $ry) {
             pdf_circle($this->_pdf, $this->_getX($x), $this->_getY($y), $rx);
         } else {
             pdf_moveto($this->_pdf, $this->_getX($x - $rx), $this->_getY($y));
             pdf_curveto($this->_pdf, $this->_getX($x - $rx), $this->_getY($y), $this->_getX($x - $rx), $this->_getY($y - $ry), $this->_getX($x), $this->_getY($y - $ry));
             pdf_curveto($this->_pdf, $this->_getX($x), $this->_getY($y - $ry), $this->_getX($x + $rx), $this->_getY($y - $ry), $this->_getX($x + $rx), $this->_getY($y));
             pdf_curveto($this->_pdf, $this->_getX($x + $rx), $this->_getY($y), $this->_getX($x + $rx), $this->_getY($y + $ry), $this->_getX($x), $this->_getY($y + $ry));
             pdf_curveto($this->_pdf, $this->_getX($x), $this->_getY($y + $ry), $this->_getX($x - $rx), $this->_getY($y + $ry), $this->_getX($x - $rx), $this->_getY($y));
         }
         if ($line && $fill) {
             pdf_fill_stroke($this->_pdf);
         } elseif ($line) {
             pdf_stroke($this->_pdf);
         } elseif ($fill) {
             pdf_fill($this->_pdf);
         }
     }
     parent::ellipse($params);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:42,代码来源:PDF.php

示例3: ellipse

 /**
  * Draw an ellipse
  *
  * Parameter array:
  * 'x': int X center point
  * 'y': int Y center point
  * 'rx': int X radius
  * 'ry': int Y radius
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function ellipse($params)
 {
     if (isset($params['url'])) {
         if ($params['rx'] == $params['ry']) {
             $this->_addMapTag('circle', $this->_getX($params['x']) . ',' . $this->_getY($params['y']) . ',' . $this->_getX($params['rx']), $params);
         } else {
             $points = '';
             for ($v = 0; $v <= 360; $v += 30) {
                 if ($points != '') {
                     $points .= ',';
                 }
                 $points .= round($this->_getX($params['x']) + $this->_getX($params['rx']) * cos(deg2rad($v % 360))) . ',' . round($this->_getY($params['y']) + $this->_getX($params['ry']) * sin(deg2rad($v % 360)));
             }
             $this->_addMapTag('polygon', $points, $params);
         }
     }
     parent::ellipse($params);
 }
开发者ID:villos,项目名称:tree_admin,代码行数:30,代码来源:ImageMap.php

示例4: ellipse

 /**
  * Draw an ellipse
  *
  * Parameter array:
  * 'x': int X center point
  * 'y': int Y center point
  * 'rx': int X radius
  * 'ry': int Y radius
  * 'fill': mixed [optional] The fill color
  * 'line': mixed [optional] The line color
  * @param array $params Parameter array
  */
 function ellipse($params)
 {
     $x = $this->_getX($params['x']);
     $y = $this->_getY($params['y']);
     $rx = $this->_getX($params['rx']);
     $ry = $this->_getY($params['ry']);
     $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('<ellipse ' . 'cx="' . round($x) . '" ' . 'cy="' . round($y) . '" ' . 'rx="' . round($rx) . '" ' . 'ry="' . round($ry) . '" ' . 'style="' . $style . '"' . '/>', $params);
     }
     parent::ellipse($params);
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:26,代码来源:SVG.php

示例5: ellipse

 /**
  * Draw an ellipse
  *
  * Parameter array:
  * 'x'    : int X center point
  * 'y'    : int Y center point
  * 'rx'   : int X radius
  * 'ry'   : int Y radius
  * 'fill' : mixed [optional] The fill color
  * 'line' : mixed [optional] The line color
  * 'url'  : string [optional] Target URL
  *
  * @param array $params Parameter array
  *
  * @return void
  */
 function ellipse($params)
 {
     $x = $this->_getX($params['x']);
     $y = $this->_getY($params['y']);
     $rx = $this->_getX($params['rx']);
     $ry = $this->_getY($params['ry']);
     // calculate scale factors
     $scaleX = 1.0;
     $scaleY = 1.0;
     $moveX = 0;
     $moveY = 0;
     if ($rx > $ry) {
         $scaleY = $ry / $rx;
         $moveY = $ry * (1 - $scaleY);
     } elseif ($rx < $ry) {
         $scaleX = $rx / $ry;
         $moveX = $rx * (1 - $scaleX);
     }
     $fillColor = isset($params['fill']) ? $params['fill'] : false;
     $lineColor = isset($params['line']) ? $params['line'] : false;
     $fillColor = $this->_getFillStyle($fillColor);
     $lineColor = $this->_getLineStyle($lineColor);
     $shape = new SWFShape();
     $shape->setRightFill($fillColor[0], $fillColor[1], $fillColor[2]);
     $shape->movePenTo($x, $y);
     $shape->setLine(1, $lineColor[0], $lineColor[1], $lineColor[2]);
     if (count($fillColor)) {
         $shape->setRightFill($fillColor[0], $fillColor[1], $fillColor[2]);
     }
     $shape->drawCircle(max($rx, $ry));
     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);
         $ellipse = $this->_canvas->add($button);
     } else {
         $ellipse = $this->_canvas->add($shape);
     }
     $ellipse->move($moveX, $moveY);
     $ellipse->scaleTo($scaleX, $scaleY);
     parent::ellipse($params);
 }
开发者ID:roojs,项目名称:pear,代码行数:58,代码来源:SWF.php


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