how to return the pixel cordinate from a mouse click ?!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahmoudadelnour
    New Member
    • Oct 2010
    • 1

    how to return the pixel cordinate from a mouse click ?!

    i want to make a function/ method as i want to display a picture and make the user click on some points on this picture and save this points coordinate.

    something like "impixel" function in matlab.

    and i don't know how to do it.

    thanks,
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Have a look at the Bitmap class (search this on MSDN). There are methods to access pixel data. If your picture is in a picturebox, the mouse events (mouse move, mouse click, etc...) should provide coordinates as to the location of that event, which are in pixels.

    Hope that helps!

    Comment

    Working...