Skip to content

Instantly share code, notes, and snippets.

@BrunoVT1992
Last active May 13, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrunoVT1992/5efb0e0b32ef5e98ed8d3f4abd82cf56 to your computer and use it in GitHub Desktop.
Save BrunoVT1992/5efb0e0b32ef5e98ed8d3f4abd82cf56 to your computer and use it in GitHub Desktop.
Converter to blur an UIImage in Xamarin iOS
using UIKit;
using CoreImage;
namespace iOS
{
public static class UIImageConverter
{
public static UIImage Blur(UIImage image)
{
var ciImage = new CIImage(image);
var gaussian_blur = new CIGaussianBlur()
{
Image = ciImage,
Radius = 5f,
};
var output = gaussian_blur.OutputImage;
var context = CIContext.FromOptions(null);
var cgImage = context.CreateCGImage(output, output.Extent);
return UIImage.FromImage(cgImage);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment