problem in using gd library please help

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
sara933
Forum Newbie
Posts: 11
Joined: Thu May 15, 2008 10:01 am

problem in using gd library please help

Post 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
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: problem in using gd library please help

Post 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.
Post Reply