Page 1 of 1

How to determine if a mouse click ocurred in the img space?

Posted: Thu Mar 24, 2011 2:43 pm
by leopsc
Hi!

I have a AnnotationViewer and it has an image. How can I determine if a mouse click occured inside of the image space?

I'm using C# in Visual Studio 2008 (Framework 3.5).

Thanks!

Re: How to determine if a mouse click ocurred in the img space?

Posted: Thu Mar 24, 2011 7:36 pm
by Alex
Hello,

You can subscribe to the AnnotationViewer.MouseClick event and analyze the position of the mouse cursor in the image using the AnnotationViewer.PointToImage method.

Please read descriptions of the ImageViewer.PointToImage and ImageViewer.PointToControl methods in the documentation.

Best regards, Alexander

Re: How to determine if a mouse click ocurred in the img space?

Posted: Thu Mar 24, 2011 8:11 pm
by leopsc
Thanks a lot!!! It works!