如何在C#中处理像素级别的图像

问题描述:

如何在C#中以像素级操作图像?

How do I manipulate images at the pixel level in C#?

我需要能够分别读取/修改每个位图像素RGB值。

I need to be able to read/modify each bitmap pixel RGB values separately.

我们将非常感谢代码示例。

A code sample would be appreciated.

如果你想要速度,然后 LockBits 请参阅此处,了解鲍勃鲍威尔的演练。如果您只想编辑一些,请 GetPixel / SetPixel 应该做什么你想要的。

If you want speed, then LockBits. See here for a good walkthrough by Bob Powell. If you just want to edit a few, then GetPixel/SetPixel should do what you want.