<div dir="ltr">I have an animated canvas that I use for animation. I've never put it up on PLaneT, but use it for many of my own applications. I can send an example app if you want.<br><br>Doug<br><br><div class="gmail_quote">
On Sun, Sep 21, 2008 at 7:58 AM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Neil and Robby have given you good general answers --- compute the<br>
target without referring to the image, or use regions instead of an<br>
offscreen image --- but I'll answer the original questions:<br>
<div class="Ih2E3d"><br>
At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote:<br>
> 1) Is it possible to draw a canvas to an offscreen buffer ?<br>
<br>
</div>You can take a function that draws to a canvas and redirect it so that<br>
it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a<br>
canvas `dc<%>').<br>
<div class="Ih2E3d"><br>
> 2) Is it possible to fetch pixel values from a canvas.<br>
<br>
</div>Canvas drawing is one-way only: you can send an image out to the user<br>
to see, but you cannot programmatically "look" at the canvas. Also,<br>
there's no way to take a snapshot of the canvas to get back an<br>
offscreen image.<br>
<br>
If you redirect a drawing function to an offscreen image, then you<br>
can, of course, inspect the pixels of the offscreen image.<br>
<font color="#888888"><br>
<br>
Matthew<br>
</font><div><div></div><div class="Wj3C7c"><br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</div></div></blockquote></div><br></div>