I am newbie in graphics. I have a panel which I have used to plot some points. Now I will click anywhere in the panel and I need to find the point which is nearest to the Clicked point. Which is the best way to find that. Could someone help me.
@Yahia Actually i have created a some points which will look like
. . . .
. . . .
. . . .
And now i will click in between those points and i need to find the nearest point from where i clicked and color it different.
The code i used is
PlotterMap = new Bitmap(this.pnlPlotterMap.Width, this.pnlPlotterMap.Height,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
BufferGraphics = Graphics.FromImage(PlotterMap);
BufferGraphics.FillEllipse(brush, plcolplot.XPixel1, plcolplot.YPixel1,2,2);
In click event of your panel, pick the point where click has been done. Start creating circles in increasing radius starting with 1 (don’t draw this, just create object n code behind) and try to find out which per-defined point intersect with your circle first.