starter's problem with gd
Posted: Wed Aug 27, 2008 10:08 am
A few days ago, I start reading about GD, now I'm trying to do small tutorial to see how the lib works. This is the code I have, is a copy of the starte's tutorial in phpgd.com:
<?php
$image = imagecreate(200,200);
var_dump($image);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,0,0,199,199,$black);
?>
Can you see an error that I cant? What I'm doing wrong?
thanks in advance
Caedo.
pd:
btw, this is the info of GD showed by phpinfo():
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled
<?php
$image = imagecreate(200,200);
var_dump($image);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,0,0,199,199,$black);
?>
Can you see an error that I cant? What I'm doing wrong?
thanks in advance
Caedo.
pd:
btw, this is the info of GD showed by phpinfo():
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled