Blur an UIImage on change of slider

前端 未结 3 1553
走了就别回头了
走了就别回头了 2021-02-02 04:00

I have tried gaussian blur and checked out all the questions on stackoverflow but no one of them solved my crash issue.Please help is there is any other way to blur image other

3条回答
  •  无人共我
    2021-02-02 04:13

    Not sure about how to blur an image. This may help is you want to blur an UIImageView or any view.

       UIView *myView = self.theImageView;
        CALayer *layer = [myView layer];
        [layer setRasterizationScale:0.25];
        [layer setShouldRasterize:YES];
    

    You can undo it by setting the rasterization scale back to 1.

    [layer setRasterizationScale:1.0];
    

    UPDATE:

    The below Apple sample code includes a blur/sharp effect. (using Open GL) See if it helps, http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html

提交回复
热议问题