C# Picturebox 刷新 Refresh()图像一闪而过
问题描述:
重载OnPaint函数
在OnPaint函数中使用了
Graphics gra = this.pictureBox1.CreateGraphics();
重新创建了Graphics导致图像一闪而过。
改为e.Graphics即可。
本文解决了一个C#开发中PictureBox图像显示一闪而过的问题。通过调整绘图方式,从使用pictureBox1.CreateGraphics()更改为使用e.Graphics,解决了图像显示不连续的问题。
C# Picturebox 刷新 Refresh()图像一闪而过
问题描述:
重载OnPaint函数
在OnPaint函数中使用了
Graphics gra = this.pictureBox1.CreateGraphics();
重新创建了Graphics导致图像一闪而过。
改为e.Graphics即可。

被折叠的 条评论
为什么被折叠?
