When the mouse is clicked at a point on the picture box during the run time( i.e when the image is loaded) it should change color of the pixels at that location.i have this piece of code showing error.
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
Bitmap bm=new Bitmap(1,1);
bm.SetPixel(0,0,Color.Red);
e.Graphics.DrawImageUnscaled(bm,e.X,e.Y);
}
the error is ‘System.Windows.Forms.MouseEventArgs’ does not contain a definition for ‘Graphics’ and no extension method ‘Graphics’ accepting a first argument of type ‘System.Windows.Forms.MouseEventArgs’ could be found (are you missing a using directive or an assembly reference?)
even though i included system.drawing it is showing this error.
Try changing the image in the picturebox instead of trying to redraw it, as the MouseEventArgs does not contain any Graphics property.
Example:
EDIT: Alowed multiple pixels to be selected in accordance with a fill radius