[wxPython] zooming!

Hi,
I'm make some drawing objects with wxDC in a wxScrolledWindow.
It's no problem to zoom (SetUserScale) with my mouse wheel, but I want the zoom to follow my mouse pointer.
(pointer = centre of zoom)

Is there any examples somewhere, or do someone of you have an idé......

// s.holmgren

I have a very similar problem (which I havn't solved yet!). I want to
zoom in on a wxDC which takes the form of a panel in a wxScrollWindow. I
can zoom the panel size using SetUserScale, but I cannot get it to zoom
cleanly on the *center* of the ScrollWindow view-port. I'm trying to use
SetScrollBars() to set the correct view-port position but things are not
well behaved: The window always seems to jump back to the origin on
calling SetScrollBars().

Can anyone suggest a better way of positioning the wxScrollWindow
viewport which avoids SetScrollBars()?

Bryan

···

On Tue, 2002-08-06 at 10:28, Holmgren Stefan wrote:

Hi,
I'm make some drawing objects with wxDC in a wxScrolledWindow.
It's no problem to zoom (SetUserScale) with my mouse wheel, but I want the zoom to follow my mouse pointer.
(pointer = centre of zoom)

Is there any examples somewhere, or do someone of you have an idé......

// s.holmgren

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Hello,

Since it will always zoom around (0,0) you will have to use wxDC::SetDeviceOrigin to set the origin to
the desired position. But than the drawing position will be different
too.
I never tried but maybe you can use wxDC::DeviceToLogical.. to correct
that.

However I used Numeric for zooming, since I didn't liked the variation
in the thickness of the lines.

Tuesday, August 6, 2002, 2:28:19 AM, you wrote:

···

Hi,
I'm make some drawing objects with wxDC in a wxScrolledWindow.
It's no problem to zoom (SetUserScale) with my mouse wheel, but I want the zoom to follow my mouse pointer.
(pointer = centre of zoom)

Is there any examples somewhere, or do someone of you have an idé......

// s.holmgren

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

--
Best regards,
Lucian mailto:gemes@gmx.at

Lucian wrote:

I for myself did use wxDC, but moving and zooming did cause flicker
and double buffering was too slow, on 1600x1200 screen resolution.

hmm. I've used wxDCs quite a bit, for a fairly involved zommable and
scrollable object canvas, and find double buffering to be extremely
fast.

Now I use PyOpenGL and I am very happy with it, can be integrated with
wxPython, is hardware supported, and the displaylist's makes it
reasonable able fast,

Having said the above,k I've been meaning to look at OPenGL. I am
waiting for a chance to find the time to get over the learning hurdle.
Also, most of the docs I've seen talk so much about 3-d that I have3
troub le seeing how I'd use it for 2-d.

Do you have a fairly sinmple sample you could send out? Ideally with
some kind of hit-test or events or something. I need to be able to click
on objects and initiate events.

-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

hmm. I've used wxDCs quite a bit, for a fairly involved zommable and
scrollable object canvas, and find double buffering to be extremely
fast.

How did you implement the double buffering? I tried to draw on a bmp
in the background.

Do you have a fairly sinmple sample you could send out? Ideally with
some kind of hit-test or events or something. I need to be able to click
on objects and initiate events.

It's actually quite simple. I will put a small demo together.
Currently I handle the picking for my self. No problem with other 2000
object, I just look which is the next to the mouse click.

Lucian

···

--
Best regards,
Lucian mailto:gemes@gmx.at

I've done a similar thing with a project that's still under
development. But you can take a look at the double buffering code
in CVS. It's very fast (it's all my calculations that slow down my
app). Check out Qualm download | SourceForge.net and looks
in cvs at: /qualm/graphs/graph_tools.py for the buffer and canvas
objects.

                    -- Mike

···

On Tue, Aug 13 @ 00:51, Lucian wrote:

How did you implement the double buffering? I tried to draw on a bmp
in the background.

--
Michael Gilfix
mgilfix@eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html"