Software & Finance





C# - Drawing Pixels





Drawing a single pixel in C# is not a built in function. However you can make it very easily by writing a function given below:

void PutPixel(Graphics g, int x, int y, Color c)

{

      Bitmap bm = new eBitmap(1, 1);

      bm.SetPixel(0, 0, Color.Red);

      g.DrawImageUnscaled(bm, x, y);

}


I have used this function in Drawing Circle by pixels page.