The problem is that the coordinates are "between" the pixels. There is an explanation of this in the context of another library, but the issues are the same:<br><br> <a href="http://docs.racket-lang.org/teachpack/2htdpimage.html?q=2htdp/image#%28part._nitty-gritty%29">http://docs.racket-lang.org/teachpack/2htdpimage.html?q=2htdp/image#%28part._nitty-gritty%29</a><br>
<br>hth,<br>Robby<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 8:29 AM, Garrett Mitchener <span dir="ltr"><<a href="mailto:garrett.mitchener@gmail.com" target="_blank">garrett.mitchener@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I'm learning the racket GUI package, and I ran into something that doesn't make sense to me:<br><br>#lang racket/gui<br>
<br>(define black-pen<br> (new pen%<br> [width 1]<br> [color "black"]))<br>
<br>(define blue-brush<br> (new brush%<br> [color "blue"]))<br><br>(define (draw-test-2 dc)<br> (send dc scale 10 10)<br> (send dc set-pen black-pen)<br> (send dc set-brush blue-brush)<br> (send dc draw-rectangle 7 2 4 4))<br>
<br>(define pic (make-bitmap 200 100))<br><br>(define dc (new bitmap-dc% [bitmap pic]))<br><br>(draw-test-2 dc)<br><br>And at the end, pic looks like this:<br><br><img src="" alt="Inline image 1"><br>
The outline and the filling don't line up. What am I doing wrong? This is with DrRacket 5.2.1 on linux.<br><br>Thanks,<br>-- Garrett Mitchener<br>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br>