faqts : Computers : Programming : Languages : Python : Common Problems : Images

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 13 people (85%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I create a wxBitmap image from a Python Imaging Library (PIL) image?

Jul 12th, 2000 20:25
unknown unknown, Greg Landrum


Here's some sample code:
def PilImgToWxBmp(pilImg):
  wxImg = wxEmptyImage(pilImg.size[0],pilImg.size[1])
  wxImg.SetData(pilImg.tostring())
  bmp = wxImg.ConvertToBitmap()
  return bmp