資源簡介
使用wxpython做的畫圖軟件,需要支持wxpython
代碼片段和文件信息
#!/usr/bin/env?python
#_*_encoding:cp936_*_
import?wx
import?os
import?cPickle
import?wx.lib.buttons?as?buttons
import?wx.html
class?SketchWindow(wx.Window):
????def?__init__(self?parent?ID):
????????wx.Window.__init__(self?parent?ID)
????????self.SetBackgroundColour(“White“)
????????self.color?=?“Black“
????????self.thickness?=?1
????????self.curLine?=?[]
????????self.pen?=?wx.Pen(self.color?self.thickness?wx.SOLID)
????????self.lines?=?[]
????????self.pos?=?(0?0)
????????self.InitBuffer()
????????
????????self.Bind(wx.EVT_LEFT_DOWN?self.OnLeftDown)
????????self.Bind(wx.EVT_LEFT_UP?self.OnLeftUp)
????????self.Bind(wx.EVT_MOTION?self.OnMotion)
????????self.Bind(wx.EVT_SIZE?self.OnSize)
????????self.Bind(wx.EVT_IDLE?self.OnIdle)
????????self.Bind(wx.EVT_PAINT?self.OnPaint)
????????
????def?InitBuffer(self):
????????size?=?self.GetClientSize()
????????self.buffer?=?wx.EmptyBitmap(size.width?size.height)
????????dc?=?wx.BufferedDC(None?sel
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????26368??2012-03-06?15:02??sketch\aaaa.sketch
?????文件?????100034??2012-02-12?21:00??sketch\cloud.sketch
?????文件?????458486??2012-02-10?11:03??sketch\jcsoo.bmp
?????文件????????222??2012-02-10?11:06??sketch\new.bmp
?????文件????????222??2012-02-10?11:07??sketch\open.bmp
?????文件???????3094??2012-02-10?11:07??sketch\save.bmp
?????文件??????15897??2012-02-10?21:45??sketch\sketch.py
?????文件???????1647??2012-02-05?22:04??sketch\sketch.pyc
?????文件????????110??2012-02-10?11:10??sketch\sketch.txt
?????文件???????4440??2012-02-10?21:34??sketch\xczxczcxzcxcxcxz.sketch
?????目錄??????????0??2012-03-06?15:02??sketch
-----------?---------??----------?-----??----
???????????????610520????????????????????11
- 上一篇:4位減法、加法器設計fpga
- 下一篇:中國電信IT研發中心筆試題
評論
共有 條評論