Hello I just installed PHP and apache on my machine. I need to get some quick graphics work But when drawing images, the image does not get drawn. The font functions work but not the image ones! can anyone help me out with this?
Sincerely,
Anmol Misra
Graphics does not work with PHP
Moderator: General Moderators
The code which is problematic
<?php
$im = ImageCreate(200,200);
$white= ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black= ImageColorAllocate($im,0x33,0x37,0x10);
ImageFilledRectangle($im,100,100,150,150,black);
ImageString($im,5,50,160,"A Black Box",$black);
header('Content-Type: image/gif');
ImagePNG($im);
?>
$im = ImageCreate(200,200);
$white= ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black= ImageColorAllocate($im,0x33,0x37,0x10);
ImageFilledRectangle($im,100,100,150,150,black);
ImageString($im,5,50,160,"A Black Box",$black);
header('Content-Type: image/gif');
ImagePNG($im);
?>
does it mean i have to use $black everytime!
hi does it means that I have to use $black i mean instead of black everytime. Coz the book says it is just black.
Did it work for you without $ sign infront of black. What can be the reason?
Sincerely,
Anmol Misra
Did it work for you without $ sign infront of black. What can be the reason?
Sincerely,
Anmol Misra