def draw(self):
if self.hist is None:
return
# get client device context buffer
dc = wx.BufferedDC(wx.ClientDC(self), self.buffer)
dc.Clear()
# w, h = self.GetClientSize()
# the main draw process
print("drawing histogram")
dc.SetPen(wx.Pen((100,100,100), width=1, style=wx.SOLID))
for i in range(256):
dc.DrawLine(i,80,i,80-self.hist[i])
dc.SetPen(wx.Pen((0,0,0), width=1, style=wx.SOLID))
dc.DrawLine(self.x1, 80, self.x2, 0)
dc.DrawLines([(0,0),(255,0),(255,80),(0,80),(0,0)])
评论列表
文章目录