You are here

function pImage::drawAreaMirror in Visitors 7

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

File

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

Class

pImage

Code

function drawAreaMirror($X, $Y, $Width, $Height, $Format = "") {
  $StartAlpha = isset($Format["StartAlpha"]) ? $Format["StartAlpha"] : 80;
  $EndAlpha = isset($Format["EndAlpha"]) ? $Format["EndAlpha"] : 0;
  $AlphaStep = ($StartAlpha - $EndAlpha) / $Height;
  $Picture = imagecreatetruecolor($this->XSize, $this->YSize);
  imagecopy($Picture, $this->Picture, 0, 0, 0, 0, $this->XSize, $this->YSize);
  for ($i = 1; $i <= $Height; $i++) {
    if ($Y + ($i - 1) < $this->YSize && $Y - $i > 0) {
      imagecopymerge($Picture, $this->Picture, $X, $Y + ($i - 1), $X, $Y - $i, $Width, 1, $StartAlpha - $AlphaStep * $i);
    }
  }
  imagecopy($this->Picture, $Picture, 0, 0, 0, 0, $this->XSize, $this->YSize);
}