Exemplo n.º 1
0
 /**
  * @param int $XSize
  * @param int $YSize
  * @param Data $DataSet
  * @param boolean $TransparentBackground
  */
 public function __construct($XSize, $YSize, Data $DataSet = null, $TransparentBackground = false)
 {
     parent::__construct();
     $this->TransparentBackground = $TransparentBackground;
     if ($DataSet) {
         $this->DataSet = $DataSet;
     }
     $this->XSize = $XSize;
     $this->YSize = $YSize;
     $this->Picture = imagecreatetruecolor($XSize, $YSize);
     if ($this->TransparentBackground) {
         imagealphablending($this->Picture, false);
         imagefilledrectangle($this->Picture, 0, 0, $XSize, $YSize, imagecolorallocatealpha($this->Picture, 255, 255, 255, 127));
         imagealphablending($this->Picture, true);
         imagesavealpha($this->Picture, true);
     } else {
         $C_White = $this->AllocateColor($this->Picture, 255, 255, 255);
         imagefilledrectangle($this->Picture, 0, 0, $XSize, $YSize, $C_White);
     }
 }