[plt-scheme] bitmap error from image operation in 207

From: Kathi Fisler (kfisler at cs.wpi.edu)
Date: Sat Aug 28 19:41:27 EDT 2004

I'm trying to write some simple image animations in 207 using
Matthias' image.ss library from the TeachScheme 2 workshop.  The
current one tries to drop a ball from a starting position on a window
down to the bottom of the window.  Part way through, I get an error:

     set-bitmap in memory-dc%: bad bitmap: #<struct:bitmap%>

The error shows up almost every time I run the code, but the animation
progresses a different amount each time.  The following code yields
the error (assuming the teachpack is loaded):

;; x y are ball coordinates, w and h width and height of window
(define (buildtest x y w h)
  (unless (> y h)
    (begin
      (update (place-image (disk 10 'red) x y (empty-scene w h)) produce #t)
      (buildtest x (+ y 2) w h))))

(start 300 300)
(buildtest 20 20 300 300)

[empty-scene is a call to outline-rect; place image is a call to
offset-image+.  update is a macro whose gist I can't easily reproduce
here] 

Anyone run into this before or know what kinds of problems lead to
set-bitmap errors?  (I have to do this in 207).

Thanks,
Kathi

-----------------------------------------------------------------------
Kathi Fisler, Assistant Professor	Department of Computer Science
http://www.cs.wpi.edu/~kfisler/        	Worcester Polytechnic Institute
Phone: 508-831-5118            		100 Institute Road
Fax: 508-831-5776                	Worcester, MA 01609-2280



Posted on the users mailing list.