snippet library logo
in category
PHP / Image Manipulation / GD Imaging
Snippet details
ID: 100
Viewed: 1985
Added: 2002-03-22
Version:
Sorry no demo

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable Version
This little script will test to see if you have the GD Library installed and working on your server. Very useful for running this test.

General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: snippet

<!---Head--->
none

<!---Body--->


<?
Header
("Content-type: image/png"); 

/* create image */
$image imagecreate(200,200);

/* create color R=100, G=0, R=0 */
$maroon ImageColorAllocate($image,100,0,0);

/* create color R=255, G=255, R=255 */
$white ImageColorAllocate($image,255,255,255);

/* create color green */
$green ImageColorAllocate($image,0,100,0);

/* create white background*/
ImageFilledRectangle($image,0,0,200,200,$white);

/* create frame*/
ImageRectangle($image,10,10,190,190,$maroon);

/* create inner rectangle*/
ImageFilledRectangle($image,50,70,150,150,$maroon);

/* display 5 fonts */ for ($i=1$i <= 5$i++)
ImageString($image,$i,15,$i*10,'Test',$green);

/* render image */
ImagePNG($image);

/* cleanup memory */
ImageDestroy($image);
?>




No Reviews to show


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.