private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { pointArray[iNumberofClicks].X = e.X; pointArray[iNumberofClicks].Y = e.Y; Pen PenSpikes = new Pen(Color.Green); SolidBrush solidBrush = new SolidBrush(Color.Blue); if(iNumberofClicks==0) { a = e.X; b = e.Y; } iNumberofClicks++; if (iNumberofClicks > 1) { Point[] CurrentpointArray = new Point[iNumberofClicks]; for (int aa = 0; aa < iNumberofClicks; aa++) { CurrentpointArray[aa].X = pointArray[aa].X; CurrentpointArray[aa].Y = pointArray[aa].Y; } Graphics offScreenDC = Graphics.FromImage(pictureBox1.Image); offScreenDC.DrawLines(PenSpikes, CurrentpointArray); offScreenDC.Dispose(); pictureBox1.Refresh(); } } for (int j = 1; j < CurrentpointArray.Length;j++ ) { if ((Convert.ToInt16(CurrentpointArray[j].X) == a && Convert.ToInt16(CurrentpointArray[j].Y) == b) ) { MessageBox.Show("alert"); break; } }
PictureBox
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)