function pChart::drawRectangle in Visitors 7.0
Same name and namespace in other branches
- 8 pchart/pChart.inc \pChart::drawRectangle()
3 calls to pChart::drawRectangle()
- pChart::drawBarGraph in pchart/
pChart.inc - pChart::drawFilledRectangle in pchart/
pChart.inc - pChart::drawGraphArea in pchart/
pChart.inc
File
- pchart/
pChart.inc, line 2121
Class
Code
function drawRectangle($X1, $Y1, $X2, $Y2, $R, $G, $B) {
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;
}
$C_Rectangle = imagecolorallocate($this->Picture, $R, $G, $B);
$X1 = $X1 - 0.2;
$Y1 = $Y1 - 0.2;
$X2 = $X2 + 0.2;
$Y2 = $Y2 + 0.2;
$this
->drawLine($X1, $Y1, $X2, $Y1, $R, $G, $B);
$this
->drawLine($X2, $Y1, $X2, $Y2, $R, $G, $B);
$this
->drawLine($X2, $Y2, $X1, $Y2, $R, $G, $B);
$this
->drawLine($X1, $Y2, $X1, $Y1, $R, $G, $B);
}