panel 如何实现双缓冲区绘图
panel 如何实现双缓冲区绘图
直接设置双缓冲没效果的,自定义控件然后设置, 其他代码我去掉了,你看看吧 using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; using namespace ScreenShotTools { /// <summary> /// 自定义颜色呈现标签,可选色 /// </summary> internal class ColorLabel:Control { public ColorLabel() : base() { SetStyles(); } private void SetStyles() { base.SetStyle( ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true); base.UpdateStyles(); } } }