VisLab

Chris Waters' Weblog

Visualizing the Vislab

Title: Using PIL Images with wxPython
Category: Programming/Python
Posted by:
Previous: wxPython Practice and Documentation Woes
Next: SSH minus Login

def GetWXBitmap(myImage): 
image = apply(wx.EmptyImage, myImage.size) 
image.SetData(myImage.convert("RGB").tostring()) 
# if the image has an alpha channel, 
# you can set it with this line: 
myImage = myImage.convert("RGBA") 
image.SetAlphaData(myImage.tostring()[3::4] ) 
return image.ConvertToBitmap()
 
FROM: 
http://wiki.wxpython.org/WorkingWithImages#head-7aa43a4a1e066fd28640ce86066ba0617afe2a8b 
 
Using wx.StaticBitmap (widget on the window to show the bitmap): 
http://wiki.wxpython.org/wxStaticBitmap?highlight=%28Bitmap%29 

Login Information
Username:
Password:

© Chris Waters. The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by Mississippi State University.