[racket] How do you convert an image made with 2htdp/image to a bitmap% object?
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131214/44bee03e/attachment.html>