Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Mouse Coordinates While Zooming

I want to annotate the current coordinates of the mouse pointer while the user is rubberbanding to do a zoom. MouseMove would work if I could figure out how to convert the OLE_XPOS_PIXELS coordinates to the Axes coordinates.

Why doesn't mousemove give Axes coordinates? What is the conversion to Axes coordinates?
0 Kudos
Message 1 of 3
(3,514 Views)
As you can see, the graph does not support this particular request. In this case, when you are zooming, there is no way you can calculate the coordinates in relation to the axes. You have seen we simply get the pixel points. With this method, you could use the MouseMove command to calibrate your pixels, or in other words, see how many pixels high and long the actual graph window is, and then do scaling calculations in accordance with the min and max values of the x and y axes. This however will not be all that precise, as it is limited by the size of a pixel, and the scaling settings of the graph.
A better way is to change the graph track mode to cwGTrackAllEvents from the zoom mode you were in. cwGTrackAllEvents mode allows you to use the PlotAreaMouseDown and Pl
otAreaMouseUp. These two report back the XPos and YPos in terms of the axes coordinates. Then you can output these to display for the user. At the MouseDown event, you can set the Xmin and Ymax values, and at the MouseUp, set the Xmax and YMin values. This of course means you always do the zooming from upper left to lower right. The only drawback to this method is that you never view the "rubber band", as this is a zoom feature, and is immediately lost in the cwGTrackAllEvents. Hope this solves it for you.
0 Kudos
Message 2 of 3
(3,514 Views)
Unfortunately, it does not help. I wish to update the x and y coordinates in real time was the zoom rectangle is being defined by the rubberbanding process. I wish to display the current graph coordinates as the user "rubber bands". MouseUP and MouseDown doesn't cut it. I need MouseMove coordinates.
0 Kudos
Message 3 of 3
(3,514 Views)