<div dir="ltr">







<pre class="" style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:12.800000190734863px;width:744px;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)"><div class="" id="file-gistfile1-rkt-LC1">
<span class="">Here is one way to draw an annulus on a 400x400 bitmap</span></div><div class="" id="file-gistfile1-rkt-LC1"><span class="">with center (200,200) and radii 100 and 200 respectively.</span></div><div class="" id="file-gistfile1-rkt-LC1">
<span class=""><br></span></div><div class="" id="file-gistfile1-rkt-LC1"><span class="">#lang racket</span></div><div class="" id="file-gistfile1-rkt-LC2"><span class="">(</span><span class="" style="font-weight:bold">require </span><span class="" style="color:teal">racket/draw</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC3"> </div><div class="" id="file-gistfile1-rkt-LC4"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">bm</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">make-object</span> <span class="" style="color:teal">bitmap%</span> <span class="" style="color:rgb(0,153,153)">400</span> <span class="" style="color:rgb(0,153,153)">400</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC5"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">dc</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">new</span> <span class="" style="color:teal">bitmap-dc%</span> <span class="">[</span><span class="" style="color:rgb(153,0,0);font-weight:bold">bitmap</span> <span class="" style="color:teal">bm</span><span class="">]))</span></div>
<div class="" id="file-gistfile1-rkt-LC6"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">p</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">new</span> <span class="" style="color:teal">dc-path%</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC7"> </div><div class="" id="file-gistfile1-rkt-LC8"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">p</span> <span class="" style="color:teal">move-to</span> <span class="" style="color:rgb(0,153,153)">300</span> <span class="" style="color:rgb(0,153,153)">200</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC9"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">p</span> <span class="" style="color:teal">arc</span> <span class="" style="color:rgb(0,153,153)">100</span> <span class="" style="color:rgb(0,153,153)">100</span> <span class="" style="color:rgb(0,153,153)">200</span> <span class="" style="color:rgb(0,153,153)">200</span> <span class="" style="color:rgb(0,153,153)">0</span> <span class="">(</span><span class="" style="color:rgb(0,134,179)">* </span><span class="" style="color:rgb(0,153,153)">2</span> <span class="" style="color:teal">pi</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC10"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">p</span> <span class="" style="color:teal">line-to</span> <span class="" style="color:rgb(0,153,153)">400</span> <span class="" style="color:rgb(0,153,153)">200</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC11"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">p</span> <span class="" style="color:teal">arc</span> <span class="" style="color:rgb(0,153,153)">0</span> <span class="" style="color:rgb(0,153,153)">0</span> <span class="" style="color:rgb(0,153,153)">400</span> <span class="" style="color:rgb(0,153,153)">400</span> <span class="" style="color:rgb(0,153,153)">0</span> <span class="">(</span><span class="" style="color:rgb(0,134,179)">* </span><span class="" style="color:rgb(0,153,153)">2</span> <span class="" style="color:teal">pi</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC12"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">p</span> <span class="" style="color:teal">close</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC13"> </div><div class="" id="file-gistfile1-rkt-LC14"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">blue</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">the-color-database</span> <span class="" style="color:teal">find-color</span> <span class="" style="color:rgb(221,17,68)">"blue"</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC15"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">blue-brush</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">the-brush-list</span> <span class="" style="color:teal">find-or-create-brush</span> <span class="" style="color:teal">blue</span> <span class="" style="color:rgb(153,0,115)">'solid</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC16"><span class="">(</span><span class="" style="font-weight:bold">define </span><span class="" style="color:teal">blue-pen</span> <span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">the-pen-list</span> <span class="" style="color:teal">find-or-create-pen</span> <span class="" style="color:teal">blue</span> <span class="" style="color:rgb(0,153,153)">0</span> <span class="" style="color:rgb(153,0,115)">'solid</span><span class="">))</span></div>
<div class="" id="file-gistfile1-rkt-LC17"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">dc</span> <span class="" style="color:teal">set-brush</span> <span class="" style="color:teal">blue-brush</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC18"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">dc</span> <span class="" style="color:teal">set-pen</span> <span class="" style="color:teal">blue-pen</span><span class="">)</span></div>
<div class="" id="file-gistfile1-rkt-LC19"><span class="">(</span><span class="" style="color:rgb(153,0,0);font-weight:bold">send</span> <span class="" style="color:teal">dc</span> <span class="" style="color:teal">draw-path</span> <span class="" style="color:teal">p</span><span class="">)</span></div>
</pre><p class=""><span class=""><span style="color:teal;font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:12.800000190734863px">bm</span></span></p><p class=""><span class=""><span style="color:teal;font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:12.800000190734863px"><br>
</span></span></p></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/20 J. Ian Johnson <span dir="ltr"><<a href="mailto:ianj@ccs.neu.edu" target="_blank">ianj@ccs.neu.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying to make some visuals for a slideshow presentation, and I want to have a ring with borders (inner and outer ring borders) to draw over another image, thus a transparent center is necessary.<br>
I haven't been able to find a way to do this with the current API. Anyone have a suggestion (other than, "don't do that")?<br>
<br>
Thanks,<br>
-Ian<br>
____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>-- <br>Jens Axel Søgaard<br><br>
</div>