Is it possible to convert it into bitmap or icon? I'd like to avoid saving it in file and read it with wx.Bitmap, for example.
Asked
Active
Viewed 60 times
1 Answers
0
This seems to work:
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...

Mark
- 106,305
- 20
- 172
- 230
-
Thanks for answers.. but one thing. Why pb length is 4096 and img is 3072 so i get error about differ size? Is is something with alpha? – xliiv May 30 '11 at 15:03