Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.