Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将其转换为位图或图标?例如,我想避免将其保存在文件中并使用 wx.Bitmap 读取它。
这似乎有效:
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...