1. 绘图质量:设置Graphics属性
主要有:根据首字母简写为:ISCT (您可以记为: Is CT?——引伸记忆:是否CT检查?
【CT为医院的“CT检查”,这里为检查绘图质量】
比如要获得最高质量的图像,可以设置为:
Graphics g = Graphics.FromImage(bmp);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
2. 双缓冲绘图:设置ControlStyles
主要有:2Paint,2DBuffer,2R
2Paint: AllPaintingInWm+Paint, U: User+Paint,
2DBuffer: Optimized+DoubleBuffer, DoubleBuffer
2R: Resize+Redraw
比如:
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);