[wxPython] Zooming in a drawing application

Hi:

I am using wxMM_METRIC mapping mode in a wxScrolledWindow with SetScrollbars( 20, 20, 87, 59 ) i.e. equivalent to 11.5 x 17 inches sheet size. (I do not now what the implications of this are in terms of printing yet).

Anyway, I want to be able to zoom and scale my drawing up to accommodate large sizes in meters (like 1mm on screen == 100 on site).

I tried SetUserScale but the origin becomes uncoordinated. I tried, SetDeviceOrigin but can't seem to understand how it works... so far.

Does somebody know how to do this... please?

···

--

--
Kene Meniru
___________________________________________________________
--keMen@illom.net--

Kene Meniru wrote:

Anyway, I want to be able to zoom and scale my drawing up to accommodate
large sizes in meters (like 1mm on screen == 100 on site).

It sounds like you don't just need zooming, but rather a way to have the
user deal with "real" coordinates, and then have the screen display at
whatever scal you want, and the print at a defined scale. I have written
a bunch of code that solves the first of these issues, but have yet to
solve the printing one, but I don't imagine it will be that hard once I
figure out printing in general.

Anyway, Ive enclosed a zip file of my "float canvas" code. It provides a
double buffered widget that lets you draw stuff in arbitrary floating
point coordinates, and a gui to zoom in and out and scroll around. It
required NumPy, as a use that to speed up the scaling. It has a little
demo app with it. (By the way it can also do flat-earth projections for
maps)

Let me know if you have any questions or suggestions, and if you can
make use of it or any of the ideas in it.

-Chris

FloatCanvas.zip (13.6 KB)

···

--
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

Thanks a million Chris. I do not need printing as this is a prototype. So it seems like all I need will be available in some way in your attachment. Can't wait to get to it.

Will keep you posted as requested. Take care

···

--

--
Kene Meniru
___________________________________________________________
--keMen@illom.net--

Hi,

Anyone know what this error's about? I get it when trying to load in an image from a file, like this:

bitmap = wxBitmap('mpm-banner.jpg', wxBITMAP_TYPE_JPEG)

The wxPython demo works just fine for me though...

If you aren't allready doing so, you may need to add a call to
wxInitAllImageHandlers before you try to load the bitmap.

-tim

···

Hi,

Anyone know what this error's about? I get it when trying to load in an
image from a file, like this:

bitmap = wxBitmap('mpm-banner.jpg', wxBITMAP_TYPE_JPEG)

The wxPython demo works just fine for me though...

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