[Apache/1.3.19 (Win32) PHP/4.0.5RC1] gd

From: Date: Tue, 17 Apr 2001 08:18:11 +0000
Subject: [Apache/1.3.19 (Win32) PHP/4.0.5RC1] gd
Groups: php.windows 
Request: Send a blank email to php-windows+get-6781@lists.php.net to get a copy of this message
Hi, I downloaded and installed the php package including a lot of extensions like pdf and gd from www.mm4.de. I read the following article (http://www.phpbuilder.com/columns/rasmus19990124.php3) and tried the code (s. below). It did not work. I get an empty gif image and I do not understand what I have missed. I did the following: - I copy all extensions in the c:\winnt\system32 directory - I modified the php.ini file and only set following extensions: php_gd_gif.dll (without php_gd.dll because I got error messages telling that some functions was twice loaded), php_pdf.dll (for pdf, works wunderfull) - I put ARIAL.TTF in a web subdirectory: fonts I would be very grateful if someone could help me. christian ------------------------------ code ------------------------------- Header("Content-type: image/gif"); $font = "fonts/ARIAL.TTF"; echo imageloadfont($font); if(!isset($s)) $s=11; $size = imagettfbbox($s,0,"$font",$text); $dx = abs($size[2]-$size[0]); $dy = abs($size[5]-$size[3]); $xpad=9; $ypad=9; $im = imagecreate($dx+$xpad,$dy+$ypad); $blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF); $black = ImageColorAllocate($im, 0,0,0); $white = ImageColorAllocate($im, 255,255,255); ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black); ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white); ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "$font", $text); ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "$font", $text); ImageGif($im); ImageDestroy($im); ------------------------------ code -------------------------------

« previous php.windows (#6781) next »