Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I move a range annotation by mouse?

Hello,
 
In my application (using waveform graph v7.1.0.306) I have to highlight sections of plotted data, so I used XYRangeAnnotations to realize that. Now there's a new requirement to enable the user moving a range annotation in x-direction by mouse. In PlotArea_MouseDown and PlotArea_MouseMove I get the mouse coordinates and can use them to get the clicked annotation object via

Annotation ContextAnno = NIGraph.GetAnnotationAt(e.X, e.Y);

This works so far. When the user keeps the mouse button pressed and moves the mouse, I want to update the annotation range, where I need the coordinates related to the x-axis. Is there a way to convert the mouse coordinates into the x-axis coordiates? Or any alternative?

Thanks in advance!

Andy

0 Kudos
Message 1 of 4
(3,692 Views)

Hello,

any ideas how I can move a range annotation (rectangle) by mouse are welcome!

Best regards,

Andy

0 Kudos
Message 2 of 4
(3,678 Views)
You might want to look at this post for a poor man's inverse map implementation.

Brock
Message 3 of 4
(3,659 Views)

Thanks Brock!

It's exactly that I was looking for. Smiley Very Happy

Andreas

0 Kudos
Message 4 of 4
(3,648 Views)