Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用以下代码从图像中读取单个像素:
private void CheckArea(Point where) { Bitmap test = (Bitmap)PanelToBitmap(panel2); var pixel = test.GetPixel(where.X, where.Y); }
我想改变这个像素的颜色。首先,我尝试将其转换为图像,但这不起作用。然后我尝试更改 ARGB 值,但它们是写保护的。
如何更改给定图像中像素的颜色Point?
Point
您可以使用 :
test.SetPixel(where.X, where.Y, Color.FromArgb(0x78FF0000));
微软
颜色是一个不可变的结构,所以你不能改变它的值。