function pDraw::drawAlphaPixel in Visitors 7.2
Same name and namespace in other branches
- 7 pChart/class/pDraw.class.php \pDraw::drawAlphaPixel()
2 calls to pDraw::drawAlphaPixel()
- pDraw::drawAntialiasPixel in pChart/
class/ pDraw.class.php - pDraw::drawFromPicture in pChart/
class/ pDraw.class.php
File
- pChart/
class/ pDraw.class.php, line 1168
Class
Code
function drawAlphaPixel($X, $Y, $Alpha, $R, $G, $B) {
if (isset($this->Mask[$X])) {
if (isset($this->Mask[$X][$Y])) {
return 0;
}
}
if ($X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize) {
return -1;
}
if ($R < 0) {
$R = 0;
}
if ($R > 255) {
$R = 255;
}
if ($G < 0) {
$G = 0;
}
if ($G > 255) {
$G = 255;
}
if ($B < 0) {
$B = 0;
}
if ($B > 255) {
$B = 255;
}
if ($this->Shadow && $this->ShadowX != 0 && $this->ShadowY != 0) {
$AlphaFactor = floor($Alpha / 100 * $this->Shadowa);
$ShadowColor = $this
->allocateColor($this->Picture, $this->ShadowR, $this->ShadowG, $this->ShadowB, $AlphaFactor);
imagesetpixel($this->Picture, $X + $this->ShadowX, $Y + $this->ShadowY, $ShadowColor);
}
$C_Aliased = $this
->allocateColor($this->Picture, $R, $G, $B, $Alpha);
imagesetpixel($this->Picture, $X, $Y, $C_Aliased);
}