[racket] Annulus with dc%?

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Fri Sep 20 14:11:12 EDT 2013

Here is one way to draw an annulus on a 400x400 bitmap
with center (200,200) and radii 100 and 200 respectively.

#lang racket
(require racket/draw)

(define bm (make-object bitmap% 400 400))
(define dc (new bitmap-dc% [bitmap bm]))
(define p (new dc-path%))

(send p move-to 300 200)
(send p arc 100 100 200 200 0 (* 2 pi))
(send p line-to 400 200)
(send p arc 0 0 400 400 0 (* 2 pi))
(send p close)

(define blue (send the-color-database find-color "blue"))
(define blue-brush (send the-brush-list find-or-create-brush blue 'solid))
(define blue-pen (send the-pen-list find-or-create-pen blue 0 'solid))
(send dc set-brush blue-brush)
(send dc set-pen blue-pen)
(send dc draw-path p)

bm




2013/9/20 J. Ian Johnson <ianj at ccs.neu.edu>

> 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.
> 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")?
>
> Thanks,
> -Ian
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



-- 
-- 
Jens Axel Søgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130920/6d2513d1/attachment.html>

Posted on the users mailing list.