Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 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);
     });
 }
 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)');
     });
 }
Beispiel #4
-1
 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);
     });
 }