How to calculate the new point when i zoomed the canvas using SetUserScale method?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
dqf88
Experienced Solver
Experienced Solver
Posts: 55
Joined: Fri Aug 10, 2012 9:59 am

How to calculate the new point when i zoomed the canvas using SetUserScale method?

Post by dqf88 » Sun Dec 16, 2018 3:54 am

How to calculate the new point when i zoomed the canvas using SetUserScale method? I want the point got by mouse to be changed with zooming
Attachments
未命名-1.png
未命名-1.png (52.53 KiB) Viewed 523 times

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2781
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to calculate the new point when i zoomed the canvas using SetUserScale method?

Post by PB » Sun Dec 16, 2018 12:10 pm

Assuming we are talking about wxDC and converting mouse coordinates to wxDC ones: Did you try the appropriate functions from wxDC, such as wxDC::DeviceToLogicalX/Y()?

Post Reply