A Graphical Counter Using the Text Command in csImageFile

Count

One of the features of csImageFile is the ability to add text to an image with control over fonts and sizes. This example shows a page counter made from a previously drawn image (a badly drawn rabbit holding a flag) and the count total is added to suit.

Variations on this idea can be used for messages, "tips of the day" or virtual postcards.

This page is simple and contains no important scripting. The <img> tag for the rabbit points to another script which calls csImageFile, calculates the count from a text file, loads the blank rabbit, draws the text and streams it to the browser. The PNG file used for input contains a transparent colour which is used when the GIF is output.

Example of the <img> tag:

<img src="specialcountdemo.cfm">

Click Here for the listing of "specialcountdemo.cfm", the script that produces the image.

We also have a demo of a more traditional counter which can be viewed here.