retrieve image axis range


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
I can't provide any further help than that of thomas_braun, but I would be very interested if you get it to work. I have written something similar but not as elegant. My strategy for zooming in an image is to to have 4 sliders - for min & max x & y values. The user can then scroll over the sliders with the mouse wheel which adjusts the scaling using:

 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
ScaleSliders.png
arrg, I was checking out AxisInfo already but obviously overlooked SETAXISCMD!

Thanks!

edit: @Thomas.Dane: if I get it to work I'll post it here!
ChrLie wrote:
I'm on a function that would allow me to zoom in or out an image using the mouse wheel.

Check out what you get if you select Graph->Packages->Graph Magnifier.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
A similiar approach to the "Graph Magnifier" from John, would be to adjust the magnification of the graph. The magnification can be set either from the "Modify Graph" menu or via "ModifyGraph expand=e" programmatically.

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.