That works perfectly, thanks David!
(define (resize-draw canvas0 bm)
(let* ((dc (send canvas0 get-dc))
(t (send dc get-transformation)))
(send dc scale
(/ (send canvas0 get-width) (send bm get-width))
(/ (send canvas0 get-height) (send bm get-height)))
(send dc draw
Usually you adjust the drawing context's scale. Something like (untested):
(define bm (read-bitmap ...))
(define dc (send image-box get-dc))
(define t (send dc get-transformation)) ; save old scale
(send dc scale
(/ (send image-box get-width) (send bm get-width))
(/ (send image-box get-heigh
2 matches
Mail list logo