1
我有以下MonoTouch
代碼,它可以改變Saturation
,但我也想改變Hue
。Monotouch:改變圖像的色調,而不僅僅是飽和度
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);
Miguel在MonoTouch(包括鏈接過濾器)上使用CoreImage製作了一個很好的視頻(在YouTube上)。 http://www.youtube.com/watch?v=Yb2pi3tDb3c – poupou 2012-08-01 17:50:02
該示例在Retina設備上不起作用,返回的圖像尺寸不正確。 – 2012-08-05 17:49:39
請澄清:當你說「不適用於Retina設備」時,你是不是指「使用UINavigationController.Appearance.SetBackgroundImage時」(按照SO#11805628)?通常我相信這段代碼在將UIImage分配給正確設置了邊界的UIImageView時確實有效。 – Conceptdev 2012-08-12 10:48:44