logo
The Falcon Programming Language
A fast, easy and powerful programming language
Location: Developers community >> GD2 Library Binding >> Wiki docs
User ID:
Password:
 

GD2 Library Binding


What is GD2 for?

GD2 is a module binding LibGD, which is meant for offline/batch image manipulation. In short, it allows to deal with a set of very common image file formats, manipulate them and save them. Integrating it in a web server (i.e. through the Falcon Apache2 module), you can create server-side dynamic image generators, as in the following example:

Generated image
This is a PNG image dynamically generated through a server-side FTD script:

<?
   load gd2

   Reply.ctype("image/png")
   img = GdImage( 200, 200 )

   blue = img.ColorAllocate( 10, 10, 90 )
   white = img.ColorAllocate( 0xff, 0xff, 0xff )

   font = gdFontGetMediumBold()

   for i = 1 to 10
       img.String( font, 5, i * 15 + 2, "Hello " + i + " times.", white )
   end

   out = stdOut()
   img.Png( out )
?>

Index

The ability to create graphs from server data (i.e. DB entries) on the fly is quite precious, even when different techniques to generate graphics at the client site are now becoming common.


Go To Page...

Loading

Elapsed time: 0.025 secs. (VM time 0.020 secs.)