Reply to comment
While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?
While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?
gyurisc
#
This controll is supercool! Thanks for taking the time and writing the control and articles.
I have one question though. If I click on the control, how can I get the coordinates of the click on the original image?
Richard Moss
#
gyurisc,
Thanks for the comment. I was working on a small update to the control, but as I haven't got one of the bugs fixed yet I'll just post the function you need in this comment.
[csharp] public virtual Point PointToImage(Point point) { Rectangle viewport; int x; int y;
[/csharp]
Add this to your copy of ImageBox, then call it as you would the PointToClient and PointToScreen methods, for example:
[csharp] private void imageBox_MouseMove(object sender, MouseEventArgs e) { Point point;
[/csharp]
Note that this function always returns 1 more than the actual point, as Point.Empty returns true for 0,0 and I can't return null for a structure. A bit annoying...
Hope this helps!
Regards; Richard Moss