Now we actually load and display an Image! We use a wx.Image which reads a graphic image from our hard-drive.
First we show the image’s dimensions in the status-bar using .SetStatusText(…). Next we use the new ShowBitmap(self) function to convert the Image to a wx.StaticBitmap which is shown inside the Panel. We ask the Frame to resize itself to fit the picture and also to center itself on-screen.
This is one of our Club ShowMeDo Python tutorials, these build upon our free wxPython tutorials which live with our 179 Python tutorials. The source code for this episode is freely available (they all are) further down the video’s page.
“Really quite enjoying this series – coming back everyday to see if another part has been uploaded!” – John Montgomery
If you enjoyed this post, make sure you subscribe to my RSS feed!
“…Nevertheless, this is still one of the best tutorial videos I’ve ever seen and trust me: I’ve seen lot’s of ‘em!” – Lucas Holland