[plt-scheme] Writing a game and have questions

From: Doug Williams (m.douglas.williams at gmail.com)
Date: Sun Sep 21 11:20:30 EDT 2008

Here is a little demo - a not so good boids implementation.  But it shows
how the animated canvas works.

On Sun, Sep 21, 2008 at 9:02 AM, Doug Williams <m.douglas.williams at gmail.com
> wrote:

> 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.
> Doug
> On Sun, Sep 21, 2008 at 7:58 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>> Neil and Robby have given you good general answers --- compute the
>> target without referring to the image, or use regions instead of an
>> offscreen image --- but I'll answer the original questions:
>> At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote:
>> > 1) Is it possible to draw a canvas to an offscreen buffer ?
>> You can take a function that draws to a canvas and redirect it so that
>> it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a
>> canvas `dc<%>').
>> > 2) Is it possible to fetch pixel values from a canvas.
>> Canvas drawing is one-way only: you can send an image out to the user
>> to see, but you cannot programmatically "look" at the canvas. Also,
>> there's no way to take a snapshot of the canvas to get back an
>> offscreen image.
>> If you redirect a drawing function to an offscreen image, then you
>> can, of course, inspect the pixels of the offscreen image.
>> Matthew
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080921/0609bc0a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boids.ss
Type: application/octet-stream
Size: 4348 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20080921/0609bc0a/attachment.obj>

Posted on the users mailing list.