[plt-scheme] problem with draw-bitmap method

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Mar 27 08:35:09 EST 2003

At Thu, 27 Mar 2003 14:21:00 +0100 (CET), Berticolas Copimasso wrote:
> we make the bitmap with 
> (define thegif (make-object  bitmap% "nameOfGif.gif"
> 'gif/mask))
> then we try to draw the bitmap on the drawing context
> with 
> (send dc (draw-bitmap thegif x y 'solid (make-object
> color% "black") (send thegif get-loaded-mask)))
> it doesn't work, shows nothing , and return #f 
> when we try to draw the mask, it draws a transparent
> black image .

What operating systems do you use? (Sorry if you've answered that
before; I forget.)

When you draw the `thegif' without using the mask, does it work ok? If
so, maybe it's something about your image that triggers a bug, and if
you can send me your image, I'll take a look.

The program below works for me in Windows, where "bumpthumb.gif"



(define bm (make-object bitmap% "e:/matthew/bumpthumb.gif" 'gif/mask))
(define f (instantiate frame% ("Test")))
(define c (instantiate canvas% (f)
            [paint-callback (lambda (c dc)
                              (send dc draw-bitmap 
                                    bm 0 0 
                                    'solid (make-object color% 0 0 0)
                                    (send bm get-loaded-mask)))]))
(send f show #t)

Posted on the users mailing list.