2011-05-29 30 views

回答

0

这似乎工作:

import wx 
import gtk 

pb = gtk.gdk.pixbuf_new_from_file("someFile.jpg") 
img = wx.EmptyImage(pb.get_width(), pb.get_height()) 
img.SetData(pb.get_pixels()) 
## you can now convert the wx.Image to wx.Bitmap etc... 
+0

感谢答案..但一两件事。为什么PB长度是4096,IMG是3072,所以我得到不同大小的错误?是与阿尔法? – xliiv 2011-05-30 15:03:10