Tag: getpixel

C# – 更快的替代SetPixel和GetPixel的Windows窗体应用程序位图

我想教自己的C#,并从各种各样的消息来源得知,函数获取和setpixel可以是非常缓慢。 什么是一些替代scheme,性能改进真的很重要? 提前致谢! 我的代码的一大块供参考: public static Bitmap Paint(Bitmap _b, Color f) { Bitmap b = new Bitmap(_b); for (int x = 0; x < b.Width; x++) { for (int y = 0; y < b.Height; y++) { Color c = b.GetPixel(x, y); b.SetPixel(x, y, Color.FromArgb(cA, fR, fG, fB)); } } return b; }