General zoom algorithm for drawing program
Posted
by Steven Sproat
on Stack Overflow
See other posts from Stack Overflow
or by Steven Sproat
Published on 2010-04-18T21:49:04Z
Indexed on
2010/04/18
21:53 UTC
Read the original article
Hit count: 301
My GUI toolkit, wxPython provides some methods for implementing a user zoom factor, however the quality isn't too good. I'm looking for ideas on how to create a zooming feature, which I know is complicated.
I have a bitmap representing my canvas which is drawn to. This is displayed inside a scrolled window.
Problems I forsee: - performance when zoomed in and panning around the canvas - difficulties with "real" coordinates and zoomed in coordinates - image quality not degrading with the zoom
Using wxPython's SetUserScale() on its device contexts presents image quality like this - this is with a 1px line, at 30% zoomed in.
I'm just wondering the general steps I'll need to take and the challenges I'll encounter. Thanks for any suggestions
© Stack Overflow or respective owner