Welcome  |  Blog: On My Mind... (proxied)  |  Photos (PHP Photo Album)  |  Photos (Picassa)

19 October 2005

GD Percent Example

CGI On-The-Fly Progress Bar

I recently thought I had an actual reason to use GD.pm, turns out I didn't, but while I was messing with it... I created this app that creates a PNG graphic Progress Bar on the fly.

In it's least interesting form, it creates a 200x20 graphic (within an HTML with JavaScript wrappings) that "onClick" increments. As the HTML wrapping suggests, this was for testing purposes.

/cgi-bin/percent.cgi

More fun is the ability to create almost any size with any percentage by request. For example:

The image from "/cgi-bin/percent.cgi/90x200/33":
example

Of course, JavaScript can change the image...  Go ahead, play.

Width:
Height:
Percent:

You can view and download the code: percent.cgi.pl.