C# 用颜色矩阵改变色调?
我正在尝试模拟 Photoshop 中的颜色选择器。我有一个 256x256 位图渐变,X 轴上有饱和度,Y 轴上有亮度。当我改变值 0 到 360 时,位图相应地改变色调。
我让它在大部分情况下工作,但我使用一个函数将每个像素从 HSV 更改为 RGB 值,然后将值分配到位图中(使用指针),但当我快速更改值时它有点闪烁。是否可以通过使用 ColorMatrix 缩放位图来更改色调?
I'm trying to emulate the color picker in photoshop. I have a 256x256 bitmap gradient that has saturation on X-axis and brightness on Y-axis. As I vary through the values 0 to 360, the bitmap changes hue accordingly.
I have it working for the most part but I'm using a function that changes each pixel from HSV to RGB values and then assigning the values into the bitmap (using pointers) but it kinda flickers when I change the values quickly. Is it possible to change the hue by scaling a bitmap with a ColorMatrix?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 ColorMatrix (http://msdn.microsoft.com /en-us/library/system.drawing.imaging.colormatrix.aspx) 仅适用于 ARGB 空间,因此您不能简单地用它们调整色调。
虽然它并没有严格回答你的问题。您可以通过在更新时禁用刷新来消除闪烁。
I believe ColorMatrix (http://msdn.microsoft.com/en-us/library/system.drawing.imaging.colormatrix.aspx) only apply in ARGB space, so you can't simply adjust hue with them.
Although it does not strictly answer your question. You could eliminate the flicker by disabling refresh while updating.