Re: [racket] Using 2htdp/image with racket-gui

2015-03-19 Thread Robby Findler
Oh, I see. In that case, they should use the render-image function directly. Override the on-paint method, call the get-dc method and pass that and some suitable coordinates to do the drawing. I recommend using this only for drawing the final image, don't use other dc methods (I mean, you can, but

Re: [racket] Using 2htdp/image with racket-gui

2015-03-19 Thread Andrew Mauer-Oats
Thanks. Yes, they want to (say) draw a solid green circle next to the name of someone who has been active in the last five minutes. As I understand it, they followed the GUI Toolkit intro and arrived at the point where they have a canvas% with the on-paint method specified in its constructor. The o

Re: [racket] Using 2htdp/image with racket-gui

2015-03-19 Thread Alexander D. Knauth
Here’s one way, if you mean a bitmap% object: #lang racket/base (provide image->bitmap) (require racket/class (only-in racket/draw make-bitmap bitmap-dc%) (only-in 2htdp/image image-width image-height) (only-in mrlib/image-core render-image)) (define (image->bitmap im

Re: [racket] Using 2htdp/image with racket-gui

2015-03-19 Thread Robby Findler
When you say "bitmap" do you mean "bitmap% object"? And if so, why do they want to do that? If not, do you mean something else? Robby On Thu, Mar 19, 2015 at 5:24 PM, Andrew Mauer-Oats wrote: > Is there a public way to change an image created using the 2htdp/image > library into a bitmap? > > M