[plt-scheme] Re: Writing a game and have questions

From: Deep (deepankar.sharma at gmail.com)
Date: Sun Sep 21 11:18:48 EDT 2008

Thanks for the very detailed, prompt and helpful answers. I decided to
ditch the offscreen-buffer based approach and instead decided to
implement a convex polygon + point in poly approach.

Neil - thanks for the suggestions, I found them really helpful.
Mathew - thanks for the rendering tips, i have a feeling they will be
useful in the future.
Doug - It would be great if you could send me an example app.

Thanks,
Deepankar



On Sep 21, 11:02 am, "Doug Williams" <m.douglas.willi... 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 <mfl... 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
>
>
>
>  animated-canvas.ss
> 4KViewDownload
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.