And Now: Getting PHP graphics to work 3March2003 WWIII
I did the rpm install thing and phpinfo() has this:
'--with-gd' '--enable-gd-native-ttf'
does this mean that GD graphics should work? [ seems like Yes... see below]
I try graphics and get this message:
The image http://localhost/graph23.php cannot be displayed, because it contains errors.
when I get a message "contains errors" I know I have regressed back to a time before 1986 when compilers began to report error number & line numbers.
==============================================
this is graph23.php
<?php header("content-type:image/png");
$Image=ImageCreate(400,200);
$green=ImageColorAllocate($Image,0,255,0);
$red=ImageColorAllocate($Image,255,0,0);
imagesetthickness($Image,5);
Imageline($Image,10,10,200,150,$red);
ImagePNG($Image);
ImageDestroy($Image);
?>
so what are the errors contained in this?
++++++++++++++++++++++++++++++++++++++++++++++
i believe the error is in
imagesetthickness($Image,5);
because this works:
<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$im=ImageCreate(400,200);
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
$green=ImageColorAllocate($im,0,255,0);
$red=ImageColorAllocate($im,255,0,0);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
?>
++++++++++++++++++++++++++++++++++++++++++++++
note: on http://www.php.net/manual/en/function.imagesetthickness.php
darklife at chello dot reports:
"This function does not work properly, since the results are awefull!..."
- this is bad news for a simple programmer who merely wishes to draw a few lines
++++++++++++++++++++++++++++++++++++++++++++++