【发布时间】:2016-11-15 18:27:15
【问题描述】:
我正在使用 wx python 来绘制仪表。我使用drawarc和drawCircle。 但结果并不如我所料。圆弧和圆没有精确绘制,看起来很丑。 GaugeImage
pen = wx.Pen(wx.WHITE,2)
dc.SetPen(pen)
xFullCoordinate = (x + (OutsideRadius * math.cos((0.5 * math.pi) + (FullDeg * math.pi * newValue)/((MaxValue - MinValue) * 180))))
yFullCoordinate = (y + (OutsideRadius * math.sin((0.5 * math.pi) + (FullDeg * math.pi * newValue)/((MaxValue - MinValue) * 180))))
xStartCoodrinate = (x + (OutsideRadius * math.cos((0.5 * math.pi) + (StartDeg * math.pi) / 180)))
yStartCoodrinate = (y + (OutsideRadius * math.sin((0.5 * math.pi) + (StartDeg * math.pi) / 180)))
dc.DrawArc((xFullCoordinate,yFullCoordinate),(xStartCoodrinate,yStartCoodrinate),(x, y))
dc.SetBrush(wx.Brush((48,100,175)))
dc.DrawCircle(x, y, InsideRadius)
【问题讨论】:
标签: wxpython automatic-ref-counting draw