本文整理汇总了PHP中Image_Canvas::pieslice方法的典型用法代码示例。如果您正苦于以下问题:PHP Image_Canvas::pieslice方法的具体用法?PHP Image_Canvas::pieslice怎么用?PHP Image_Canvas::pieslice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image_Canvas
的用法示例。
在下文中一共展示了Image_Canvas::pieslice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pieslice
/**
* Draw a pie slice
*
* Parameter array:
* 'x': int X center point
* 'y': int Y center point
* 'rx': int X radius
* 'ry': int Y radius
* 'v1': int The starting angle (in degrees)
* 'v2': int The end angle (in degrees)
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
* 'fill': mixed [optional] The fill color
* 'line': mixed [optional] The line color
* @param array $params Parameter array
*/
function pieslice($params)
{
if (isset($this->_imageMap)) {
$this->_imageMap->pieslice($params);
}
parent::pieslice($params);
}
示例2: pieslice
/**
* Draw a pie slice
*
* Parameter array:
* 'x': int X center point
* 'y': int Y center point
* 'rx': int X radius
* 'ry': int Y radius
* 'v1': int The starting angle (in degrees)
* 'v2': int The end angle (in degrees)
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
* 'fill': mixed [optional] The fill color
* 'line': mixed [optional] The line color
* @param array $params Parameter array
*/
function pieslice($params)
{
$x = $this->_getX($params['x']);
$y = $this->_getY($params['y']);
$rx = $this->_getX($params['rx']);
$ry = $this->_getY($params['ry']);
$v1 = $this->_getX($params['v1']);
$v2 = $this->_getY($params['v2']);
$srx = isset($params['srx']) ? $this->_getX($params['srx']) : false;
$sry = isset($params['sry']) ? $this->_getX($params['sry']) : false;
$fillColor = isset($params['fill']) ? $params['line'] : false;
$lineColor = isset($params['line']) ? $params['line'] : false;
$dv = max($v2, $v1) - min($v2, $v1);
if ($dv >= 360) {
$this->ellipse($params);
} else {
$style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);
if ($style != '') {
$x1 = $x + $rx * cos(deg2rad(min($v1, $v2) % 360));
$y1 = $y + $ry * sin(deg2rad(min($v1, $v2) % 360));
$x2 = $x + $rx * cos(deg2rad(max($v1, $v2) % 360));
$y2 = $y + $ry * sin(deg2rad(max($v1, $v2) % 360));
$this->_addElement('<path d="' . 'M' . round($x) . ',' . round($y) . ' ' . 'L' . round($x1) . ',' . round($y1) . ' ' . 'A' . round($rx) . ',' . round($ry) . ($dv > 180 ? ' 0 1,1 ' : ' 0 0,1 ') . round($x2) . ',' . round($y2) . ' ' . 'Z" ' . 'style="' . $style . '"' . '/>', $params);
}
parent::pieslice($params);
}
}
示例3: pieslice
/**
* Draw a pie slice
*
* Parameter array:
* 'x': int X center point
* 'y': int Y center point
* 'rx': int X radius
* 'ry': int Y radius
* 'v1': int The starting angle (in degrees)
* 'v2': int The end angle (in degrees)
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
* 'fill': mixed [optional] The fill color
* 'line': mixed [optional] The line color
* @param array $params Parameter array
*/
function pieslice($params)
{
$x = $this->_getX($params['x']);
$y = $this->_getY($params['y']);
$rx = $this->_getX($params['rx']);
$ry = $this->_getY($params['ry']);
$v1 = $this->_getX($params['v1']);
$v2 = $this->_getY($params['v2']);
$srx = $this->_getX($params['srx']);
$sry = $this->_getY($params['sry']);
$fillColor = isset($params['fill']) ? $params['line'] : false;
$lineColor = isset($params['line']) ? $params['line'] : false;
// TODO Implement PDFLIB::pieSlice()
parent::pieslice($params);
}
示例4: pieslice
/**
* Draw a pie slice
*
* Parameter array:
* 'x': int X center point
* 'y': int Y center point
* 'rx': int X radius
* 'ry': int Y radius
* 'v1': int The starting angle (in degrees)
* 'v2': int The end angle (in degrees)
* 'srx': int [optional] Starting X-radius of the pie slice (i.e. for a doughnut)
* 'sry': int [optional] Starting Y-radius of the pie slice (i.e. for a doughnut)
* 'fill': mixed [optional] The fill color
* 'line': mixed [optional] The line color
* @param array $params Parameter array
*/
function pieslice($params)
{
if (isset($params['url'])) {
$x = $this->_getX($params['x']);
$y = $this->_getY($params['y']);
$rx = $params['rx'];
$ry = $params['ry'];
$v1a = $params['v1'];
$v2a = $params['v2'];
$v1 = min($v1a, $v2a);
$v2 = max($v1a, $v2a);
$srx = isset($params['srx']) ? $params['srx'] : 0;
$sry = isset($params['sry']) ? $params['sry'] : 0;
$points = round($x + $srx * cos(deg2rad($v1 % 360))) . ',' . round($y + $sry * sin(deg2rad($v1 % 360))) . ',';
for ($v = $v1; $v < $v2; $v += 30) {
$points .= round($x + $rx * cos(deg2rad($v % 360))) . ',' . round($y + $ry * sin(deg2rad($v % 360))) . ',';
}
$points .= round($x + $rx * cos(deg2rad($v2 % 360))) . ',' . round($y + $ry * sin(deg2rad($v2 % 360)));
if ($srx != 0 || $sry != 0) {
$points .= ',';
for ($v = $v2; $v > $v1; $v -= 30) {
$points .= round($x + $srx * cos(deg2rad($v % 360))) . ',' . round($y + $sry * sin(deg2rad($v % 360))) . ',';
}
}
$this->_addMapTag('polygon', $points, $params);
}
parent::pieslice($params);
}