本文整理汇总了PHP中Intervention\Image\Image::rectangle方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::rectangle方法的具体用法?PHP Image::rectangle怎么用?PHP Image::rectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intervention\Image\Image
的用法示例。
在下文中一共展示了Image::rectangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rectangle
/**
* Draw rectangle in current image starting at point 1 and ending at point 2
*
* @param string $color
* @param integer $x1
* @param integer $y1
* @param integer $x2
* @param integer $y2
* @param boolean $filled
* @return \Intervention\Image\Image
* @static
*/
public static function rectangle($color, $x1 = 0, $y1 = 0, $x2 = 10, $y2 = 10, $filled = true)
{
return \Intervention\Image\Image::rectangle($color, $x1, $y1, $x2, $y2, $filled);
}
示例2: runOverlay
public function runOverlay(Image $image, $width, $color)
{
return $image->rectangle($width / 2, $width / 2, $image->width() - $width / 2, $image->height() - $width / 2, function ($draw) use($width, $color) {
$draw->border($width, $color);
});
}
示例3: drawRect
private function drawRect(Image $img, $xstart, $ystart, $rectwidth, $rectheight)
{
$img->rectangle($xstart, $ystart, $xstart + $rectwidth, $ystart + $rectheight, function ($draw) {
$draw->background('rgba(' . rand(0, 255) . ',' . rand(0, 255) . ',' . rand(0, 255) . ',1.0)');
});
}
示例4: itemsHeader
protected function itemsHeader()
{
$this->image->rectangle(0, 1150, $this->image->getWidth(), 1265, function (AbstractShape $shape) {
$shape->background($this->template->getColorEven());
});
$this->image->polygon([$this->image->getWidth(), 1150, $this->image->getWidth(), 1265, 2000, 1265, 2150, 1150], function (AbstractShape $shape) {
$shape->background($this->template->getPrimaryColor());
});
$this->image->rectangle(0, 1265, $this->image->getWidth(), 1270, function (AbstractShape $shape) {
$shape->background($this->template->getPrimaryColor());
});
$this->image->text(Strings::upper($this->translate('item')), 165, 1205, function (Font $font) {
$font->color($this->template->getPrimaryColor());
$font->file($this->template->getFontBold());
$font->valign('center');
$font->align('center');
$font->size(37);
});
$this->image->text(Strings::upper($this->translate('count')), 1250, 1205, function (Font $font) {
$font->color($this->template->getPrimaryColor());
$font->file($this->template->getFontBold());
$font->valign('center');
$font->align('center');
$font->size(37);
});
$this->image->text(Strings::upper($this->translate('pricePerItem')), 1650, 1205, function (Font $font) {
$font->color($this->template->getPrimaryColor());
$font->file($this->template->getFontBold());
$font->valign('center');
$font->align('center');
$font->size(37);
});
$this->image->text(Strings::upper($this->translate('total')), 2250, 1205, function (Font $font) {
$font->color($this->template->getColorOdd());
$font->file($this->template->getFontBold());
$font->valign('center');
$font->align('center');
$font->size(37);
});
}