Re: Subject GD library and creating images.
| From: | Alain Samoun | Date: | Thu, 07 Sep 2000 17:25:01 +0000 |
| Subject: | Re: Subject GD library and creating images. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2508@lists.php.net to get a copy of this message | ||
If you use Apache as a module, it won't work.
In your PHP.INI, add or uncomment:
extension=php_gd.dll In the windows extensions paragraph.
Below, is a test code that works for me.
Alain
START OF CODE TO TEST GD:
=========================
<?php
header ( "Content-type: image/jpeg");
# create a new image
$im = ImageCreate(100,100);
# allocate some colors
$white = ImagecolorAllocate($im,255,255,255);
$black = ImagecolorAllocate($im,0,0,0);
$red = ImagecolorAllocate($im,255,0,0);
$blue = ImagecolorAllocate($im,0,0,255);
# make the background transparent and interlaced
ImageColortransparent($im,$white);
Imageinterlace($im,'true');
# Put a black frame around the picture
Imagerectangle($im,0,0,99,99,$black);
# Draw a blue oval
Imagearc($im,50,50,95,75,0,360,$blue);
# And fill it with red
Imagefill($im,50,50,$red);
#binmode STDOUT;
Imagestring($im,1,25,30,"Test ",$white);
Imagestring($im,2,25,40,"Test ",$white);
Imagestring($im,3,25,50,"Test ",$white);
Imagestring($im,4,25,70,"Test ",$white);
/*
#This won't work if your GD version do not support GIF
open (GIF,"adoblogo.gif") || die;
$SrcImage = newFromGif GD::Image(GIF) || die;
close GIF;
$myImage = new GD::Image(300,300);
$myImage->copy($SrcImage,200,200,0,0,100,100);
# Convert the image to GIF and print it on standard output
print Imagegif;
print $myImage->gif;
*/
Imagejpeg($im);
?>
===================== END OF CODE
On Thu, Sep 07, 2000 at 12:12:00PM -0700, afan wrote:
> Hi, we are having trouble using the GD libraries to creates images on an NT environment. Has
> anyone installed this before and if so, could you please tell us where to put these files?
>
> Also do you know if there is any php.ini changes needed.
>
> And perhaps a little sample script.
>
> Sorry but can't figure out the instructions from GD on this.
>
> Thanks.