如何将rgb转换为hsv [英] How do I convert rgb to hsv
问题描述
抱歉,我需要更正我的问题。
现在我使用下面的代码进行转换。
public static void ColorToHSV(颜色,双色调,双重饱和度,双倍值)
{
int max = Math.Max(color.R, Math.Max(color.G,color.B));
int min = Math.Min(color.R,Math.Min(color.G,color.B));
hue = color.GetHue();
饱和度=(max == 0)? 0:1d - (1d * min / max);
value = max / 255d;
}
如何在PictureBox中显示?
对不起,我是新手。
Sorry,I need to correct my question.
Now I use below code to convert.
public static void ColorToHSV(Color color, out double hue, out double saturation, out double value)
{
int max = Math.Max(color.R, Math.Max(color.G, color.B));
int min = Math.Min(color.R, Math.Min(color.G, color.B));
hue = color.GetHue();
saturation = (max == 0) ? 0 : 1d - (1d * min / max);
value = max / 255d;
}
How to show that in "PictureBox" ??
Sorry, I'm a novice.
推荐答案
我还没试过做这是我从谷歌搜索,希望能帮助您解决问题。
如何将RGB颜色更改为HSV? [ ^ ]
希望,它有帮助:)
I haven't tried doing this but following link I've found from google search and hopefully help you getting resolved your problem.
How to change RGB color to HSV?[^]
Hope, it helps :)
这篇关于如何将rgb转换为hsv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!