龙珠第4部国语版全集:在C#用GDI+对picturebox绘图的问题

来源:百度文库 编辑:中科新闻网 时间:2024/05/04 11:51:33
为什么使用picturtbox的onpaint 事件后 pitcturbox.image为空
private void pictureBox1_Paint(object sender,PaintEventArgs e)
{
int a = 32;
Graphics dra = e.Graphics;
SolidBrush Brush_Black = new SolidBrush(Color.Black);
SolidBrush Brush_White = new SolidBrush(Color.White);
dra.FillRectangle(Brush_Black, 0, 0, 512, 256);
dra.FillRectangle(Brush_White, 128 - a / 2, 128 - a / 2, a, a);
dra.FillRectangle(Brush_White, 256 + 128 - a / 2, 128 - a / 2, a, a);
}
用pictureBox1.Image.Save(dlg.FileName,System .Drawing .Imaging .ImageFormat.Bmp);保存 picturebox1.image 为空

你的代码