retrieve image axis range
ChrLie
I'm on a function that would allow me to zoom in or out an image using the mouse wheel.
I use WMWinHookStruc and s.mouseLoc to get the mouse position on the image (ideally the pixel under the mouse should stay more or less where it is) and then s.wheelDy to handle zooming. This could be done by changing the displayed axis range using SetAxis.
What I can't figure out, is how to retrieve the present axis range. It's probably something simple, but I just couldn't find it!
Cheers
C
Hope that helps,
Thomas
March 16, 2012 at 04:10 am - Permalink
sprintf ModifyGraphCMD, "ModifyGraph/W=%s width={perUnit,%g,bottom}, height={perUnit,%g,left}",pathImageWindow,ScaleVal,ScaleVal
where "scaleVal" changes to keep the image the same size in the image window (embedded in a panel). Not the best solution, but it works! See the image.
Tom
March 16, 2012 at 04:53 am - Permalink
Thanks!
edit: @Thomas.Dane: if I get it to work I'll post it here!
March 16, 2012 at 05:14 am - Permalink
Check out what you get if you select Graph->Packages->Graph Magnifier.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
March 16, 2012 at 09:22 am - Permalink
The current magnification can be readout by parsing the graph recreation macro, and the mouse wheel would magnifiy/demagnify the graph. As nowadays screen real estate is not that precious anymore this is quite feasible.
March 16, 2012 at 10:09 am - Permalink