Monotouch:改变图像的色调,而不仅仅是饱和度 [英] Monotouch: Changing the Hue of an image, not just Saturation
本文介绍了Monotouch:改变图像的色调,而不仅仅是饱和度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下 MonoTouch
代码可以更改饱和度
,但我也试图更改 Hue
。
I have the following MonoTouch
code which can change the Saturation
, but I am trying to also change the Hue
.
float hue = 0;
float saturation = 1;
if (colorCtrls == null)
colorCtrls = new CIColorControls() {
Image = CIImage.FromCGImage (originalImage.CGImage) };
else
colorCtrls.Image = CIImage.FromCGImage(originalImage.CGImage);
colorCtrls.Saturation = saturation;
var output = colorCtrls.OutputImage;
var context = CIContext.FromOptions(null);
var result = context.CreateCGImage(output, output.Extent);
return UIImage.FromImage(result);
推荐答案
它是不同过滤器的一部分,所以你需要使用 CIHueAdjust
而不是 CIColorControls
来控制色调。
It's part of a different filter so you'll need to use CIHueAdjust
instead of CIColorControls
to control the hue.
这篇关于Monotouch:改变图像的色调,而不仅仅是饱和度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文