C#, hover over bitmap pixel and get the coordinates?
does anyone know how to do this? I presume it uses some sort of event handler but i wondered if anyone could set me on my path?
Also, how does one show that yellow textbox which sometimes appears when you hover over processional software and it gives some information about what to fill in the textfield, thats perferably how i wish to show the coordinates? I dont know the name of what its called.
In IE 8, if you h开发者_如何学运维over over the name of a tab, it comes up.
Thank you in advance
Evets actually are not the way to go here. You want to show picture coordinates, pixel_accuracy. Mouse events are actually not accurate enough to do that. You will want to poll the mouses position on a timer and when you detect it hovering over your picture, tranlate the mouse position to pixel coordinates.
The yellow popup is called a ToolTip; search for C# ToolTips and I'm sure you'll find plenty. As for the hover, could you explain your intent better? It sounds like you may end up reinventing the wheel
If this is a webpage, Use javascript(/Jquery) to get the mouse co-ordinates and show them in a box. It would be much much easier, and dare I say it, really the only way to do it.
ASP.net isn't so much about client side interaction as you may be thinking along the lines of.
精彩评论