hello..
am looking to draw curves given a radius and an angle. Is there a function to draw this? or do I need to calculate all the points to latter do a DrawPoint() on each of them..
hello..
am looking to draw curves given a radius and an angle. Is there a function to draw this? or do I need to calculate all the points to latter do a DrawPoint() on each of them..
Hi,
On Thu, Mar 17, 2011 at 12:30 PM, PythonJourney <pythonjourney@gmail.com> wrote:
hello..
am looking to draw curves given a radius and an angle. Is there a function
to draw this? or do I need to calculate all the points to latter do a
DrawPoint() on each of them..
Yes there are a number of functions and ways to do this see the api
documentation (wxDC).
DrawEllipse
DrawEllipticArc
DrawCircle
...
El 17/03/2011 01:06 p.m., Cody Precord escribi�:
Hi,
hello..
am looking to draw curves given a radius and an angle. Is there a function
to draw this? or do I need to calculate all the points to latter do a
DrawPoint() on each of them..Yes there are a number of functions and ways to do this see the api
documentation (wxDC).DrawEllipse
DrawEllipticArc
DrawCircle
...
yes but all those fill the space inside the ellipse and circle with the color of the brush, and DrawEllipticArc draw the two lines created to make the arc and also fill the inner space..
I need to just draw simple curved line.. I try with DrawSpline() but could not get what I want..
On Thu, Mar 17, 2011 at 12:30 PM, PythonJourney<pythonjourney@gmail.com> wrote:
El 17/03/2011 01:06 p.m., Cody Precord escribi�:
Hi,
hello..
am looking to draw curves given a radius and an angle. Is there a
function
to draw this? or do I need to calculate all the points to latter do a
DrawPoint() on each of them..Yes there are a number of functions and ways to do this see the api
documentation (wxDC).DrawEllipse
DrawEllipticArc
DrawCircle
...yes but all those fill the space inside the ellipse and circle with the
color of the brush, and DrawEllipticArc draw the two lines created to
make the arc and also fill the inner space..
TO prevent filling you just need to set the wx.TRANSPARENT_BRUSH as the active brush.
I need to just draw simple curved line.. I try with DrawSpline() but
could not get what I want..
Maybe wx.GraphicsContext and wx.GraphicsPath will give you what you are looking for. Have you looked at those classes?
On 3/17/11 2:46 PM, PythonJourney wrote:
On Thu, Mar 17, 2011 at 12:30 PM, >> PythonJourney<pythonjourney@gmail.com> wrote:
--
Robin Dunn
Software Craftsman
El 17/03/2011 05:25 p.m., Robin Dunn escribi�:
On 3/17/11 2:46 PM, PythonJourney wrote:
El 17/03/2011 01:06 p.m., Cody Precord escribi�:
Hi,
On Thu, Mar 17, 2011 at 12:30 PM, >>> PythonJourney<pythonjourney@gmail.com> wrote:
hello..
am looking to draw curves given a radius and an angle. Is there a
function
to draw this? or do I need to calculate all the points to latter do a
DrawPoint() on each of them..Yes there are a number of functions and ways to do this see the api
documentation (wxDC).DrawEllipse
DrawEllipticArc
DrawCircle
...yes but all those fill the space inside the ellipse and circle with the
color of the brush, and DrawEllipticArc draw the two lines created to
make the arc and also fill the inner space..TO prevent filling you just need to set the wx.TRANSPARENT_BRUSH as the active brush.
I need to just draw simple curved line.. I try with DrawSpline() but
could not get what I want..Maybe wx.GraphicsContext and wx.GraphicsPath will give you what you are looking for. Have you looked at those classes?
I have, but to be honest, I still doesnt know how to use them properly.. I was looking for examples and explanation about them but haven found one..
Well, GraphicsContext is harder to use than DCs, and if you want a portion of circle, DC's DrawElliptic Arc should be perfect:
import wx
class DrawPanel(wx.Frame):
"""Draw a line to a panel."""
def __init__(self):
wx.Frame.__init__(self, None, title="Draw on Panel")
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, event=None):
dc = wx.PaintDC(self)
dc.Clear()
dc.SetPen(wx.Pen(wx.BLACK, 4))
#dc.SetBrush(wx.RED_BRUSH)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
dc.DrawLine(0, 0, 500, 500)
dc.DrawArc(50, 250, 250, 10, 20, 20)
dc.DrawEllipticArc(10,10, 350, 200, 0, 180)
app = wx.App(False)
frame = DrawPanel()
frame.Show()
app.MainLoop()
On 3/17/11 6:59 PM, PythonJourney wrote:
Maybe wx.GraphicsContext and wx.GraphicsPath will give you what you
are looking for. Have you looked at those classes?I have, but to be honest, I still doesnt know how to use them properly..
I was looking for examples and explanation about them but haven found one..