Back to methods & properties

Click anywhere on the image...


The source code for example.asp


<HEAD>
<TITLE>'Smart imagemap' example</TITLE>
</HEAD>
<BODY bgcolor=#ffffff>
<%
imgsrc="""imap.asp?" & Request.Form & """"
%>
<FORM action="example.asp" method=POST>
<INPUT type="image" SRC=<% =imgsrc %> border=0 width=240 height=240>
</FORM>
<HR>
<H4>The source code for <I>example.asp</I></H4>
</BODY>

The source code for imap.asp


<%;
Response.ContentType="image/gif"
Response.Expires=0
Set obj=Server.CreateObject("shotgraph.image")
size=401
obj.CreateImage size,size,4
obj.SetColor 0,153,204,204
obj.SetColor 1,0,0,0
obj.SetColor 2,255,108,0
obj.SetColor 3,0,0,204
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1

if Request.QueryString("x").Count>0 and Request.QueryString("y").Count>0 then
	x=Request.QueryString("x")(1)
	y=Request.QueryString("y")(1)
	obj.Line 0,0,x,y
	obj.Line 0,size-1,x,y
	obj.Line size-1,0,x,y
	obj.Line size-1,size-1,x,y
	obj.SetTextColor 3
	obj.SetBkMode "TRANSPARENT"
	obj.CreateBrush "BS_NULL",1,""
	obj.CreatePen "PS_SOLID",2,2
	obj.Ellipse x-5,y-5,x+5,y+5
	obj.Line x,y+8,x,y+20
	obj.Line x,y+8,x+2,y+10
	obj.Line x,y+8,x-2,y+10
	obj.CreateFont "Arial",0,0,0,False,False,False,False
	obj.TextOut x+5,y+8,"You clicked here"
end if

img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>

Back to examples