I can't work it out either, but oyu may be able to use the following techique to draw straight to a bitmap-dc which you can save.<br><br>- I can't remember where I found this; <br>#lang scheme/gui<br>(let <br> ((bitmap (make-object bitmap% 255 255))<br>
(dc (make-object bitmap-dc%))<br> (red-amount 150)<br> (image-file "test.jpg"))<br> <br> (send dc set-bitmap bitmap)<br> <br>;; do some drawing<br>(do ((x 0 (+ x 1)))<br> ((>= x 255))<br> (do ((y 0 (+ y 1)))<br>
((>= y 255)) <br> (send dc set-pixel x y<br> (make-object color% x y 50)<br> ))<br> )<br>;; <br>(when (file-exists? image-file)<br> (delete-file image-file))<br> ;; this bit saves the canvas<br>
(send bitmap save-file image-file 'jpeg 100)<br> <br> (display image-file)<br> (display (current-directory))<br> )<br><br><br><div class="gmail_quote">2009/5/14 Scott Brown <span dir="ltr"><<a href="mailto:sukottoburaun@yahoo.co.jp">sukottoburaun@yahoo.co.jp</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have created a turtle module which draws pictures using<br>
a canvas% object and the draw-line method of dc from the<br>
PLT Graphics Toolkit.<br>
Is there some way to save pictures drawn to canvas% as<br>
image files?<br>
<div class="hm"><br>
<br>
--------------------------------------<br>
Power up the Internet with Yahoo! Toolbar.<br>
<a href="http://pr.mail.yahoo.co.jp/toolbar/" target="_blank">http://pr.mail.yahoo.co.jp/toolbar/</a><br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</div></blockquote></div><br><br clear="all"><br>-- <br><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle@acm.org">stephen.degabrielle@acm.org</a><br>Telephone +44 (0)20 85670911<br>Mobile +44 (0)79 85189045<br>
<a href="http://www.degabrielle.name/stephen">http://www.degabrielle.name/stephen</a><br><br>