<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18099" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am writing a game using DrScheme (actually am
implementing this existing game <A
href="http://www.bubblebox.com/play/puzzle/539.htm">http://www.bubblebox.com/play/puzzle/539.htm</A>)
and have some questions that I ran into along the way. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I draw a tiled array of hexagons on a canvas using
paths. Now I would like to detect which hexagon is beeing clicked on. One way of
implementing this would be to render the hexagons to an offscreen buffer on
startup - where each hexagon is drawn using a unique color. When the user clicks
on screen, i fetch the color from the offscreen buffer and figure out the
hexagon being clicked on. For this I have two questions </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1) Is it possible to draw a canvas to an offscreen
buffer ?</FONT></DIV>
<DIV><FONT face=Arial size=2>2) Is it possible to fetch pixel values from a
canvas. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Feel free to suggest any alternative approaches to
solving the same problem. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Deepankar</FONT></DIV></BODY></HTML>