FWIW, you should use make-bitmap, not the make-object variant (well, unless you pass different arguments, but make-bitmap is better).
You could also use the file/convertible and maybe we should add a short function there that would convert to a bitmap directly (altho I'm not sure if that introduces unwanted dependencies). Robby On Fri, Dec 13, 2013 at 10:25 PM, Daniel Prager <[email protected]>wrote: > Maybe one for the standard library? > > (define (image->bitmap image) > (let* ([width (image-width image)] > [height (image-height image)] > [bm (make-object bitmap% width height)] > [dc (make-object bitmap-dc% bm)]) > (send dc clear) > (send image draw dc 0 0 0 0 width height 0 0 #f) > bm)) > > Dan > > ____________________ > Racket Users list: > http://lists.racket-lang.org/users > >
____________________ Racket Users list: http://lists.racket-lang.org/users

