|
|
[C#]
using (Bitmap small = new Bitmap(2, 2)) {
small.SetPixel(0, 0, Color.Red);
small.SetPixel(1, 0, Color.Green);
small.SetPixel(0, 1, Color.Blue);
small.SetPixel(1, 1, Color.Black);
using (Bitmap big = new Bitmap(small, small.Size * 250)) {
big.Save(Server.MapPath("IG8_Bitmap_SetPixel.jpg"));
}
}
Here we make a create a small Bitmap and set the colors in the
pixels. To make it easier to see we scale the Bitmap up before
saving. The output file is shown below.

IG8_Bitmap_SetPixel.jpg
|