Hello, I am having enormous trouble trying to draw a red rectangle on a jpeg. I can draw the rectangle on the image using imagefilledrectangle(), but when I try to specify red, it comes out pink. I also tried to get white as a test and can't do that either.
Please help
Here is what I have been trying.
//imagetest.php
function LoadJpeg($imgname)
{
$im = @imagecreatefromjpeg($imgname);
if ($im) {
$bgc = imagecolorallocate($im, 255,0,0);
imagefilledrectangle($im, 0, 225, 275, 240, $bgc);
return $im;
}
}
header("Content-type: image/jpg");
imagejpeg(LoadJpeg("images/rect_test.jpg"));
I call that from a different file using
<IMG SRC="imagetest.php" border="0">