在C#用GDI+对picturebox绘图的问题 10
为什么使用picturtbox的onpaint事件后pitcturbox.image为空privatevoidpictureBox1_Paint(objectsender...
为什么使用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 为空 展开
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 为空 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询