Sample 1 - Graphic Counter

Graphic counter can be used to generate visitors number on your pages and other similar purposes. It creates image with a custom text and sends it directly to your browser data stream when temporary image files are not needed.

Counter.asp


<%
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear

Dim im
Set im = CreateObject("ActiveImage.Images.1")
im.CreateImage 100,25

im.SetColor 255,255,255
im.Fill 0,0
im.SetColor 0,0,255
im.DrawText 10,3, CInt(100*RND) & " visitors"

im.SetImageType 1
im.SetJpegQuality 99
str = im.WriteToVariable
response.BinaryWrite str
im.DestroyImage
Set im = Nothing
% >

Counter.html


<html>
<head>
<title>Counter</title>
</head>

<body bgcolor="#FFFFFF">
Counter <br> <img src="counter.asp">
</body>
</html>

Counter.jpg

Picture 1. Counter.jpg 2.4 Kb

If you have any questions or bug reports, write to active.image@tonec.com for technical support.