Bitmap myImage = new Bitmap(500,400);
Graphics g = Graphics.FromImage(myImage);
g.FillRectangle(……………………);//填入任意颜色
g.DrawLine(Pens.red,0,0,50,50);
pictureBox1.Image=myImage;
pictureBox1.Image.Save("myPic",System.Drawing.Imaging.ImageFormat.Bmp);
调试欢乐多
Graphics g=Graphics.FromImage(map);
g.Clear(Color.Blue);
g.DrawLine(new Pen(Color.Red),0,0,200,200);
g.Dispose();
pictureBox1.Image=map;
pictureBox1.Image.Save(@"f:\cym\1.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
0当然是黑颜色了。