I want to write a function to zoom and drag my canvas (similar to Photoshop's "Hand-Tool".
I think I use sliders for the zoom-factor (so I got x and y for SetUserScale or something like that) but then .... I got no idea how to handle a drag-funtion which allows to scroll my picture (on my canvas) with pressed mouse button.
Does anyone know what wxPython-Function could help me??
Thank you for makeing thoughts about my problems!!
Stefan
I want to write a function to zoom and drag my canvas (similar to
Photoshop's "Hand-Tool".
I'm not familiar with Photoshop - you mean you want to scroll your canvas by
dragging on it with the mouse? You might try wxScrolledWindow (using it as
the canvas) and then invoke it's Scroll() method when the user drags on the
window.
···
On Tuesday 11 September 2001 11:05, Stefan Schubert wrote:
I got no idea how to handle a drag-funtion which allows to
scroll my picture (on my canvas) with pressed mouse button.
You need to set handlers for the basic mouse events, and then when dragging
you can manipulate the scrollbars of your wxScrolledWindow. A scroll event
will be generated followed by a paint event. You paint handler should be
optimized to only redraw what is required.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!