Display of JPEG images from Python

py pan python.pan at gmail.com
Sun Jan 8 16:15:57 EST 2006


I remember seeing somewhere saying that the "wx.StaticBitmap" is
only for small image (64x64?), is that true?

On 6 Jan 2006 07:01:24 -0800, svbrk at start.no <svbrk at start.no> wrote:
>
> You can f.i. use wxPython (www.wxPython.org). Here is a compact and
> ugly, but (almost) minimal, example of a python script that shows an
> image file:
>
> import wx
> a = wx.PySimpleApp()
> wximg = wx.Image('img.jpg',wx.BITMAP_TYPE_JPEG)
> wxbmp=wximg.ConvertToBitmap()
> f = wx.Frame(None, -1, "Show JPEG demo")
> f.SetSize( wxbmp.GetSize() )
> wx.StaticBitmap(f,-1,wxbmp,(0,0))
> f.Show(True)
> def callback(evt,a=a,f=f):
>     # Closes the window upon any keypress
>     f.Close()
>     a.ExitMainLoop()
> wx.EVT_CHAR(f,callback)
> a.MainLoop()
>
> -svein
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060108/20a17105/attachment.html>


More information about the Python-list mailing list