I am trying to scale to the side of an image display that will show the height of a displayed image (Y axis). I am using a custom vertical slide to display the scale, however after I zoom the image and then pan around I want my scale to reflect the current minimum and maximum height displayed. The problem I am having is I cannot find any way to determine what pixels are currently being displayed. Is there a way to determine some coordinate of what is currently being displayed?
Can you share the image which you use (Normal as well as Zoomed)
X and Y Co ordinates wont change if we zoom.
That's a very interesting question. It clearly should be possible to do this using Property Nodes, but (a) there are not very many of them for an IMAQdx Image, (b) I couldn't find any Help topics for them (Help for the specific Property topic was listed, but greyed out, even with a full license), and (c) the logic didn't always make sense.
I was able to determine a number of things in exploring Zoom (and ignoring Pan). Zooming does not appear to affect the Displayed Image Position, Displayed Image Size, Image Area Position, or Image Area Size. Indeed, the "Displayed Image" and "Image Area" corresponding properties are identical. Similarly, Zoom Integer remained fixed at (12, 12) regardless of zooming. I didn't look at the Image Information String (which did change, and showed "Useful" numbers), but was disappointed to see that Zoom Information Shown is just a cluster of Booleans that governs what is "shown".
But I did learn the following through experimentation. You know that if you have the Zoom Tool selected and click on an Image, it "zooms" it. What it does appears to be the following: From the Mouse Position relative to the Image Frame and the "image" inside the Frame, the Pixel is computed (note that the Pixel coordinates appear in the Image Information String). The Zoom Factor is increased by 1 (from 1 to 2, 2 to 3, etc.), the Image is expanded about the selected Pixel, then the Image is redisplayed, attempting to keep the Selected Pixel at the same spatial location, subject to some boundary-rounding conditions I haven't quite deduced. [If you click on the central Pixel, you will stay there through multiple zooms, but if you try this near the corner, say (4, 4), you'll see the selected pixel change to (3, 3), (2, 2), etc. as the Zoom increases.]
I haven't investigated all the functions in the IMAXdx toolbox (and don't claim to be an "Image Expert" -- I just use some of these tools to view, manipulate, and do simple analysis of images), so there may be other things to do. I'll be interested to see what turns up on this Post.
Thanks for having a look at this Bob. I have still not been able to find a solution to my question. For the purpose of the application that I am working on what I have done is hid the tools for the IMAQ Image display and created my own button for zoom. This zooms around the center of the image and therefore I can easily calculate how many pixels are displayed above and below the center of the image based on the new zoom level. I then re-calulate my real world scale values. This does work for the current application but eventually I would like to be able to pan around at a magnified level and have my scale values update according to the part of the image that is being displayed.