Hi, I would like to draw a ring or piece of ring (annulus), see http://en.wikipedia.org/wiki/Annulus_%28mathematics%29
I just read the wx documents about Device Context Drawing Functions, I see there is no such function.
Any good suggestions.
PS: what I can think is draw two circles(arcs or elliptic arcs), and the inner one is filled with the background color.
Thanks.
How to draw a ring (annulus) in wxWidgets Topic is solved
Re: How to draw a ring (annulus) in wxWidgets
probably the easiest way, yes.PS: what I can think is draw two circles(arcs or elliptic arcs), and the inner one is filled with the background color.
Re: How to draw a ring (annulus) in wxWidgets
If you don't need the inner part to be transparent, that works.PS: what I can think is draw two circles(arcs or elliptic arcs), and the inner one is filled with the background color.
Otherwise, it can be done with wxGraphicsContext:
Code: Select all
wxPaintDC dc(this)
wxGraphicsContext *gc = wxGraphicsContext::Create( dc );
gc->SetPen(*wxBLACK_PEN);
gc->SetBrush(*wxRED_BRUSH);
wxGraphicsPath p = gc->CreatePath();
p.AddCircle(100, 100, 100);
p.AddCircle(100, 100, 50);
//gc->StrokePath(p); // this would just draw two circles
gc->FillPath(p);
delete gc;
Use the source, Luke!
Re: How to draw a ring (annulus) in wxWidgets
Thanks you for all your guys' help.
I'm currently use the simplest method(I don't need transparent feature).
I'm currently use the simplest method(I don't need transparent feature).