[wxPython-users] Dynamic Resizing and Centering Image.

Christopher Barker Chris.Barker at noaa.gov
Thu Jan 17 10:45:02 PST 2008


Robin Dunn wrote:
>> Based on Mike's advice, I added EVT_SIZE event handler to Chris's =

>> sample code.

> By handling the EVT_SIZE yourself you prevent the sizer from doing its =

> job, so you may as well not be using it. =


You've also changed the functionality -- your EVT_SIZE handler is =

re-scaling the image, changing it's aspect ratio -- that may be what you =

want, but it's not how the code I sent you is supposed to work. That =

code explicitly maintained the aspect ratio.

I've enclosed a slightly edited version -- I added a self.refresh() at =

the end of DisplayNext(). I didn't need that on OS-X, but apparently =

it's required on Windows.

 > add a call to  self.Layout() at the end of DisplayNext.

That doesn't seem to be required now that I've got the Refresh() call there.

-Chris



-- =

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StaticBitmap.py
Type: text/x-python
Size: 2739 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080=
117/6509582d/StaticBitmap.py


More information about the wxpython-users mailing list