[wxPython-users] img2py

Christopher Barker Chris.Barker at noaa.gov
Tue Oct 10 10:45:13 PDT 2006


justin mcguire wrote:
> ya know your right i dont know what i was thinking, its a picture that i 
> want to place on a panel that has a sizer, normally i would use a 
> wx.Image() object and put where i want it in the ()
>  dwpic = wx.Image(basepanel))

huh? I don't think you can do that at all.

> but i cannot add the location into the () for this, is there a different 
> way to add something to a panel?

If you just want the image, use:

dwpic = macroicons.getdwiconBitmap()

Sizer.Add(wx.StaticBitmap(dwpic)

A wx.Bitmap is a platform native version of a bitmap.

A wx.Image is a platform neutral 24bit RGB ini-memory version of an image.

Neither can be displayed directly, you need to put a Bitmap in a control 
of some sort:

wx.StaticBitmap
wx.BitmapButtton

or a custom class of some sort, derived from wx.,Window or wx,panel, in 
which you draw the Bitmap yourself with DCs.

see:

http://wiki.wxpython.org/index.cgi/RecipesImagesAndGraphics

For lots more info.

-CHB

-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list