scroll and pan window

Hello All,

A couple of months ago I've posted some questions here regarding usage of wxScrollWindow (my interest is to zoom and pan an image and overlaid graphics). I'm back at it (after another project and vacation). I've put together a working example and thought I'd post it here to see if anyone has any comments or suggestions for improvement.

Just load an image and zoom in on it. Note the small overlaid rectangle which zooms and pans with the image. It seems to work fairly well. The only weirdness that I can see is when you zoom in and then resize the window to where the scrollbars disappear, the image shakes.

Also, I have a larger example which also includes movable/stretchable rectangle (area of interest) in which filtering operations can be performed. Let me know if you'd like to see that.

Note: PIL is required, in addition to wxPython.

Bob

scrollTest.zip (4.3 KB)

Sounds like this would be a good candidate for the megademo that comes with wxWindows!

Just please fail nicely if PIL is not around rather than taking the whole demo out.

···

On Monday 10 March 2003 11:56 am, Bob Klimek wrote:

Also, I have a larger example which also includes movable/stretchable
rectangle (area of interest) in which filtering operations can be
performed. Let me know if you'd like to see that.

--
Chuck
http://ChuckEsterbrook.com

Bob Klimek wrote:

I'd post it here to see if anyone
has any comments or suggestions for improvement.

Nice.

Also, I have a larger example which also includes movable/stretchable
rectangle (area of interest) in which filtering operations can be
performed. Let me know if you'd like to see that.

I'd like to.

-Chris

···

--
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@noaa.gov

Yes, its not handled very gracefully, sorry. It is supposed to be just a quick and dirty little test program.

Bob

···

At 12:10 PM 3/10/2003 -0800, you wrote:

On Monday 10 March 2003 11:56 am, Bob Klimek wrote:
> Also, I have a larger example which also includes movable/stretchable
> rectangle (area of interest) in which filtering operations can be
> performed. Let me know if you'd like to see that.

Sounds like this would be a good candidate for the megademo that comes with wxWindows!

Just please fail nicely if PIL is not around rather than taking the whole demo out.

Hi Chris,

It's attached. Please note that this is a stripped-down version of a bigger program (with the scroll stuff added on), so some of the code may look a bit odd. Let me know what you think.

Bob

scrollTest2.zip (79.2 KB)

···

At 12:17 PM 3/10/2003 -0800, you wrote:

Bob Klimek wrote:
> I'd post it here to see if anyone
> has any comments or suggestions for improvement.

Nice.

> Also, I have a larger example which also includes movable/stretchable
> rectangle (area of interest) in which filtering operations can be
> performed. Let me know if you'd like to see that.

I'd like to.

Bob, all it takes is something along the lines of:

try:
  import pil.Image # or whatever
except ImportError:
  # show a dialog that says we need PIL
  wx.Message....
else:
  # do the real thing

We're talking a 4-6 lines of Python (isn't that great!?).

I really think your example program should be in the demo!

···

On Monday 10 March 2003 01:35 pm, Bob Klimek wrote:

At 12:10 PM 3/10/2003 -0800, you wrote:
>On Monday 10 March 2003 11:56 am, Bob Klimek wrote:
> > Also, I have a larger example which also includes
> > movable/stretchable rectangle (area of interest) in which
> > filtering operations can be performed. Let me know if you'd like
> > to see that.
>
>Sounds like this would be a good candidate for the megademo that
> comes with wxWindows!
>
>Just please fail nicely if PIL is not around rather than taking the
> whole demo out.

Yes, its not handled very gracefully, sorry. It is supposed to be
just a quick and dirty little test program.

--
Chuck
http://ChuckEsterbrook.com