UIImage+ImageEffects的category 模糊效果:

1.UIImage+ImageEffects是Accelerate框架中的內容;(Accelerate專門處理複雜運算和複雜效果用的)
 2.UIImage+ImageEffects的模糊效果非常美觀; (比CoreImage中blurImage的模糊效果好)

3.修改過的UIImage+ImageEffects可以對圖片進行局部模糊。

效果實現:

 //原碼網址:https://github.com/YouXianMing/UIImageBlur
   // 導入文件:UIImage+ImageEffects.h和UIImage+ImageEffects.m
    //1.導入頭文件:#import"UIImage+ImageEffects.h"
    //原始圖片
    UIImage *sourceImage = [UIImage imageNamed:@"normal"];
    //對圖片進行處理(圖片渲染用時,應在子線程中,此處未做此處理)
    UIImage *blurImage = [sourceImage blurImageAtFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)];//設置frame可進行局部模糊
    //加載圖片
    UIImageView *imageView = [[UIImageView alloc]initWithImage:blurImage];
    [self.view addSubview:imageView];


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章