[plt-scheme] writing quickly to bitmap-dc%

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Aug 5 19:16:29 EDT 2003

At Tue,  5 Aug 2003 13:10:48 -0400, Alexander Friedman wrote:
> Perhaps i could take a bitmap-dc and have the driver 
> call the equivelent functions on it directly. 

That sounds like a good strategy to me.

Or you might do better with your old code by creating a single color%
object and using `set' instead of creating a new one each time through
the loop.

One more possibility, especially if your driver can produce ARGB-format
output: MrEd provides `set-argb-pixels' and `get-argb-pixels' for
bitmap-dc%. For some reason, I keep forgetting to document these method
(but I'll fix that right now). The interface is

  (send bdc get-argb-pixels x y w h mutable-str)
  (send bdc set-argb-pixels x y w h str)

where `str' or `mutable-str' is at least w * h * 4 characters long, the
first character is the first pixel's alpha channel, the second is the
first pixel's red value, etc. The alpha channel is currently ignored
for set and filled with 255 for get. The x and y argument specifies the
top-left of the target rectangle in the drawing context.


Posted on the users mailing list.