I have the following code :
private void Calculate_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Please click the object in the image ", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.OK)
{
click_the_object();
}
}
In the click_the_object() function I want to click a pixel in the picturebox and get it's color.
The function for getting the pixel properties is :
private Color culoarepixel(Point point)
{
Bitmap bitmap = (Bitmap)pbOriginal.Image;
return bitmap.GetPixel(point.X, point.Y);
}
The problem is that I don't know how to make the click_the_object() function record only one click, the first one. I tried using eventhandlers, but it enters a loop.