You are here

function pImage::pImage in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pImage.class.php \pImage::pImage()

File

pChart/class/pImage.class.php, line 85

Class

pImage

Code

function pImage($XSize, $YSize, $DataSet = NULL, $TransparentBackground = FALSE) {
  $this->TransparentBackground = $TransparentBackground;
  if ($DataSet != NULL) {
    $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);
  }
}