本文整理汇总了PHP中Container::getImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getImage方法的具体用法?PHP Container::getImage怎么用?PHP Container::getImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::getImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Method displaying the graphical segment.
*
* @param Container $container Image in which display the element
* @param int $x_margin left margin
* @param int $y_margin top margin
* @return false if something wrong
*/
function display($container, $x_margin = 0, $y_margin = 0)
{
$image = $container->getImage();
$color = imagecolorallocate($image, $this->_r_color, $this->_g_color, $this->_b_color);
// $white = imagecolorallocate($image, 255, 255, 255);
$x1_margin = $this->_x1 + $this->_x_margin + $x_margin;
$y1_margin = $this->_y1 + $this->_y_margin + $y_margin;
// $ret = imagefilledellipse($image, $x1_margin, $y1_margin, $this->_size + 3, $this->_size + 3, $white);
$ret = imagefilledellipse($image, $x1_margin, $y1_margin, $this->_size, $this->_size, $color);
return $ret;
}
示例2: display
/**
* Method displaying the graphical polygon.
*
* @param Container $container Image in which display the element
* @param int $x_margin left margin
* @param int $y_margin top margin
* @return false if something wrong
*/
function display($container, $x_margin = 0, $y_margin = 0)
{
$image = $container->getImage();
$color = imagecolorallocate($image, $this->_r_color, $this->_g_color, $this->_b_color);
$x_margin = $this->_x_margin + $x_margin;
$y_margin = $this->_y_margin + $y_margin;
$values = array();
for ($i = 0; $i < count($this->_coordinates); $i = $i + 2) {
$values[$i] = $this->_coordinates[$i] + $x_margin;
$values[$i + 1] = $this->_coordinates[$i + 1] + $y_margin;
}
return imagefilledpolygon($image, $values, count($values) / 2, $color);
}
示例3: display
/**
* Method displaying the graphical segment.
*
* @param Container $container Image in which display the element
* @param int $x_margin left margin
* @param int $y_margin top margin
* @return false if something wrong
*/
function display($container, $x_margin = 0, $y_margin = 0)
{
$image = $container->getImage();
$color = imagecolorallocate($image, $this->_r_color, $this->_g_color, $this->_b_color);
$x1_margin = $this->_x1 + $this->_x_margin + $x_margin - $this->getXDistance();
$y1_margin = $this->_y1 + $this->_y_margin + $y_margin - $this->getYDistance();
return imagestring($image, $this->getFont(), $x1_margin, $y1_margin, $this->getText(), $color);
}
示例4: display
/**
* Method displaying the graphical segment.
*
* @param Container $container Image in which display the element
* @param int $x_margin left margin
* @param int $y_margin top margin
* @return false if something wrong
*/
function display($container, $x_margin = 0, $y_margin = 0)
{
$image = $container->getImage();
$color = imagecolorallocate($image, $this->_r_color, $this->_g_color, $this->_b_color);
$x1_margin = $this->_x1 + $this->_x_margin + $x_margin;
$y1_margin = $this->_y1 + $this->_y_margin + $y_margin;
$x2_margin = $this->_x2 + $this->_x_margin + $x_margin;
$y2_margin = $this->_y2 + $this->_y_margin + $y_margin;
$ret = imageline($image, $x1_margin, $y1_margin, $x2_margin, $y2_margin, $color);
for ($i = 1; $i <= $this->_size; $i++) {
$ret = $ret && imageline($image, $x1_margin + $i, $y1_margin, $x2_margin + $i, $y2_margin, $color);
$ret = $ret && imageline($image, $x1_margin - $i, $y1_margin, $x2_margin - $i, $y2_margin, $color);
$ret = $ret && imageline($image, $x1_margin, $y1_margin + $i, $x2_margin, $y2_margin + $i, $color);
$ret = $ret && imageline($image, $x1_margin, $y1_margin - $i, $x2_margin, $y2_margin - $i, $color);
}
return $ret;
}