本文整理汇总了PHP中Image_Canvas::line方法的典型用法代码示例。如果您正苦于以下问题:PHP Image_Canvas::line方法的具体用法?PHP Image_Canvas::line怎么用?PHP Image_Canvas::line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image_Canvas
的用法示例。
在下文中一共展示了Image_Canvas::line方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: line
/**
* 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: line
/**
* 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: 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)
{
$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: line
/**
* 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: 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)
{
$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: 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
* '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);
}