[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple bitmap question

The behaviour of the following program surprises me.
It loads a bitmap from disk and displays it in a canvas.
Executing it, one can briefly see the image, but almost
immediately, the canvas is cleared. 

Why is the canvas cleared? Have I overlooked something
(on-paint perhaps) ?

(version 200alpha12, windows XP)

(define frame (make-object frame% "Foo"))

(define bitmap (make-object bitmap% "Foo.jpg" 'jpeg))
(define h (send bitmap get-height))
(define w (send bitmap get-width))

(define canvas (instantiate canvas% () 
                 (parent frame) (min-width w) (min-height h)))
(send frame show #t)

(define dc (send canvas get-dc))
(send dc draw-bitmap bitmap 0 0 )

Jens Axel