Loading image from file name in wx.Panel

I am looking for sample code to load a PNG image inside wx.Panel, I saw a couple of them using the Python Imaging Library (PIL) and a bunch of lines of code.

I would like my environment to have as little library as possible, which means without PIL, since I don't need to do any image processing, and I suppose wx allows such processing.

thanks

EDIT : code to achieve this from Mike's answer

image = wx.Image('path/to/image.png', wx.BITMAP_TYPE_ANY) imageBitmap = wx.StaticBitmap(myPanel, wx.ID_ANY, wx.BitmapFromImage(image)) 

At the same time, any other wx widgets can be used to use the imageBitmap image.

+8
wxpython
source share
1 answer

I wrote a very simple tutorial for viewing images that can help you: http://www.blog.pythonlibrary.org/2010/03/26/creating-a-simple-photo-viewer-with-wxpython/ It just uses wxPython , I think.

+7
source share

All Articles