Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get the value by moving with the mouse on the image you want to see, and this value
Posted
Updated 10-Apr-13 1:16am
v2
Comments
Mitchell J. 10-Apr-13 7:12am    
Do you mean displaying the coordinates of the mouse?
bhagirathimfs 10-Apr-13 7:14am    
Please explain the question properly.What value you want to when you move your mouse on an image??
arifemutlu 10-Apr-13 7:24am    
ı want to pıxel coordınates yes ı mean displaying the coordinates of the mouse?

Add a MouseMove event handler to the control that is displaying the image, then modify the handler so it looks something like this:

C#
//'panel1' is just an example :-)
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
    string Coords = e.Location.ToString();
    //Then in this line set the text of the (eg)label to Coords.
}


Hope this helps :-)
 
Share this answer
 
v2
using c#

add this in your function

C#
// Set the Current cursor, move the cursor's Position

   this.Cursor = new Cursor(Cursor.Current.Handle);
   Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);
   Cursor.Clip = new Rectangle(this.Location, this.Size);
 
Share this answer
 
Comments
arifemutlu 10-Apr-13 7:51am    
Error 1 'WindowsFormsApplication2.Form1.pictureBox1_Click(object, System.EventArgs)' must declare a body because it is not marked abstract, extern, or partial
what does ıt mean ?
TrushnaK 10-Apr-13 8:36am    
I already wrote that create function then add this in your function.
your problem is that you not provide body for get; and set;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900