C# 图象保存 高手帮忙!!!
我向把图形框画的 图形保存起来,为什么不行呢?请高手帮忙!!!!!
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
Pen p1 = new Pen(Color.Red);
g2.FillRectangle(b1, 100, 100, 100, 100);
// -----------------创建图象---------------
Bitmap pic = new Bitmap(500, 500, g2);
pic.Save( "c:\\me.bmp ", ImageFormat.Bmp);
}
------解决方案--------------------private void save
{
Bitmap pic = new Bitmap(500, 500);
g = Graphics.FromImage(pic );
Pen p1 = new Pen(Color.Red);
g.FillRectangle(p1, 100, 100, 100, 100);
pic.Save( "c:\\me.bmp ", ImageFormat.Bmp);
}
看看这样的行不行,没装vs,帮不了什么