function pImage::drawAreaMirror

5.x pImage.class.php pImage::drawAreaMirror($X, $Y, $Width, $Height, $Format = "")

File

inc/pchart/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);
}