[wxPython] Drawing an Ellipse (arc)

Does any one have a implemented function for drawing an Ellipse or even
an Arc ?
It would be a very big help for me. I'm not to good at writing highly
optimized drawing functions and I need a function of more less such
form:

DrawArc( x, y, xRadius, yRadius, startAngle, endAngle, color )

Thanks for any help

Przemek

···

--
Przemysław G. Gawroński
Sekcja Systemu
Taylor Nelson Sofres OBOP
tel.: (0 22) 648 30 71
fax: (0 22) 644 99 47
mailto:P.Gawronski@obop.com.pl
http://www.obop.com.pl/
http://www.tnsofres.com/

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

I think what you want is:

#### from the wxWindows docs ########
wxDC::DrawEllipticArc

void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord width, wxCoord
height, double start, double end)

Draws an arc of an ellipse. The current pen is used for drawing the arc
and the current brush is used for drawing the pie. This function is
currently only available for X window and PostScript device contexts.

x and y specify the x and y coordinates of the upper-left corner of the
rectangle that contains the ellipse.

width and height specify the width and height of the rectangle that
contains the ellipse.

start and end specify the start and end of the arc relative to the
three-o'clock position from the center of the rectangle. Angles are
specified in degrees (360 is a complete circle). Positive values mean
counter-clockwise motion. If start is equal to end, a complete ellipse
will be drawn.

···

##############

In wxPython, it would be called like this:

DC.DrawEllipticArc(x,y,width,height,start,end)

x,y,width, and height shuld be integers
start and end could be either integers or floats

This will use the current pen and brush. You could easily wrap this in a
function that would set the pen and brush for you , if you want.

Unfortunately, I notice that it is only available for Postscript and X
window devices, whixh works fine for me on Linux, but isn't very helpful
in many other situations. That is from the docs for Version 2.1.16, but
I havn't heard anything it about it being added to other DCs.

You might want to see how the wxCanvas is coming along, it may be in
there. It has not been wrapped for wxPython yet, as far as I know.

-Chris

--
Christopher Barker,
Ph.D.
cbarker@jps.net --- --- ---
http://www.jps.net/cbarker -----@@ -----@@ -----@@
                                   ------@@@ ------@@@ ------@@@
Water Resources Engineering ------ @ ------ @ ------ @
Coastal and Fluvial Hydrodynamics ------- --------- --------
------------------------------------------------------------------------
------------------------------------------------------------------------
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Unfortunately, I notice that it is only available for Postscript and X
window devices, whixh works fine for me on Linux, but isn't very helpful
in many other situations. That is from the docs for Version 2.1.16, but
I havn't heard anything it about it being added to other DCs.

Must be a documentation bug. It works fine (on MSW at least) with a
wxPaintDC.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users