1
我有一个图像在python中使用PIL绘制。PIL绘制图像,然后在wxpython中显示它
import Image
import ImageDraw
createCM():
img = Image.new("RGB", (400,400), "white")
draw = ImageDraw.Draw(img)
coords = [(100,70), (220, 310), (200,200)]
dotSize = 2
for (x,y) in coords:
draw.rectangle([x,y,x+dotSize-1,y+dotSize-1], fill="black")
想要我现在要做的就是在我的wxpython面板上显示。
我开始喜欢这个
CMchart = createCM(self)
self.vbox = wxBoxSizer(wx.VERTICAL)
self.vbox.Add(CMchart, 1, wx.LEFT | wx.TOP | wx.GROW)
self.vbox.AddSpacer(25)
self.SetSizer(self.vbox)
self.vbox.Fit(self)
简化版,这显示任何东西。只是想知道我错了
谢谢
这是有帮助的欢呼声 – 2013-02-13 13:18:28