widgets.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:imagepy 作者: Image-Py 项目源码 文件源码
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)])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号