private Image CreateBitmap()
{
System.Drawing.Bitmap flag = new System.Drawing.Bitmap(10, 10);
for (int x = 0; x < flag.Height; ++x)
for (int y = 0; y < flag.Width; ++y)
flag.SetPixel(x, y, Color.White);
for (int x = 0; x < flag.Height; ++x)
flag.SetPixel(x, x, Color.Red);
return flag;
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Image = CreateBitmap();
}