Page 1 of 1

problem in using gd library please help

Posted: Thu May 15, 2008 2:04 pm
by sara933
hi my friend :)
I 'm a beginner in php and have some problems with it,could any body help me please:
1-I want to use gd library in my php program using xampp and phpDesigner2007 in windows
but the it doset work and the picture do not shown.(the php_gd2.dll is active in php.ini
and the extension_dir is correct)
i use some codes like this:
$height=200;
$width=200;
$im=imagecolorallocate($width,$height);
$white=imagecolorallocate($im,255,255,255);
$blue=imagecolorallocate($im,0,0,255);
imagefill($im,0,0,blue);
header('content-type:image/png');
ImagePng($im);
ImagePng($im);
Imagedestroy($im);

2- it dosent support ttf
3- when i replace new php_gd2.dll in programfiles\xampp\php\extensions phpDesigner is
destroyed and i have to reinstall it.
Regards

Re: problem in using gd library please help

Posted: Thu May 15, 2008 3:29 pm
by onion2k
Well, from part 1 of your question you appear to be missing any image creation function (imagecreate(), imagecreatetruecolor() etc) so that's not going to work. The next two are a little odd ... I use XAMPP and I know for a fact it works with GD coding. I'm using it for that right now. It's compiled with freetype so TTF fonts do work. You don't need to replace php_gd2.dll. In fact, I imagine doing that is what's breaking your IDE. PHP and the DLL are related and don't like it when you try to swap either one out without recompiling.