I have a image (png), which i load with “imagecreatefrompng”. When I’m writing to the image with “imagestring” using red and white color I get different color results. Can someone explain that to me?
see example hear : http://www.reesbeest.nl/servershot/voorbeeld.php
The code :
[COLOR=Red]<?
header(“Content-type: image/png”);
$sv_plaatje = “rb_sv_03.png”;
$randomnr = 1;
$randomnr = rand( 1, 4);
switch( $randomnr){
case 1:
$sv_plaatje = “rb_sv_01.png”;
break;
case 2:
$sv_plaatje = “rb_sv_02.png”;
break;
case 3:
$sv_plaatje = “rb_sv_03.png”;
break;
case 4:
$sv_plaatje = “rb_sv_04.png”;
break;
}
$image = imagecreatefrompng($sv_plaatje);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
imagestring($image, 3, 110, 20, “RB Public Base”, $white);
imagestring($image, 3, 110, 35, “81.19.219.128:28960”, $white);
imagestring($image, 3, 110, 50, “COD UO”, $white);
imagestring($image, 3, 110, 65, “BAS”, $white);
imagestring($image, 3, 110, 80, “mp_foy”, $white);
imagestring($image, 3, 325, 35, “1/32”, $white);
imagestring($image, 3, 325, 50, “No”, $white);
imagestring($image, 3, 325, 65, “On”, $white);
imagestring($image, 3, 325, 80, “1.51”, $white);
// Player info
imagestring($image, 3, 20, 114, “=RB=”, $red);
imagestring($image, 3, 48, 114, “ReesBeest”, $white);
imagepng($image);
imagedestroy($image);
?>
[/COLOR]
If you do refresh a few times it will cycle thru 4 different images. I will then show what I mean.
Thanks in advance
Rees