问题描述
我已阅读了几篇文章,这些文章是使用setpixel/getpixel的替代方法,但我看不到它们与我的问题有何关系.
I have read through several articles which are alternatives to using setpixel/getpixel but I am not seeing how they relate to my issue.
我有一个彩色图像,该图像(取决于从DB获取的动态值)将每个像素颜色组的颜色更改为新颜色.
I have a multicoloured image which (depending on dynamic values taken from DB) changes the color of each pixel color group to a new color.
假设我希望将Argb值为-989556的所有像素都更改为-16& Argb值为-1331的所有像素均更改为-5383962.我目前正在查看位图中的每个像素,并检查它们的值,如果它们匹配,则使用setpixel对其进行更改.
Lets say I want all pixels with Argb value of -989556 changed to -16 & all pixels with Argb value of -1331 changed to -5383962.I am currently looking at every pixel in the Bitmap and checking their value, if they match then they are changed using setpixel.
我肯定必须有更好的方法,但是我太昏暗了以至于看不到它!
I am sure there must be a better way but I am being too dim to see it!
推荐答案
看看ImageAttributes. SetRemapTable
Take a look at ImageAttributes.SetRemapTable
另一个示例.
这篇关于C#替代setpixel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!