A Graphical Counter Using the Text Command in csImageFile

Classic ASP code to create a graphical image based counter

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. It allows some sort of dynamically produced content to be added to an image on demand.

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 using BinaryWrite. 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.asp">

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

We also have a demo of a more traditional counter which can be viewed, or downloaded for you to try.

Cookies

This site uses cookies for functionality, traffic analysis and for targeted advertising. Click the Accept button to accept our Cookie Policy. The Cookie Policy page offers configuration for a reduced set of cookies for this site.