FXBlurView模糊图片处理

 UIImageView * imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];

    imageView.image = [UIImage imageNamed:@"Default-Port-hd47"];

    [self.view addSubview:imageView];

    

    FXBlurView * aview = [[FXBlurView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];

    aview.tintColor = [UIColor whiteColor];  //前景颜色

    aview.blurRadius = 20.0;                 //模糊半径

    aview.dynamic = YES;                     //动态改变模糊效果    

    [self.view addSubview:aview];

    

    FXBlurView * bview = [[FXBlurView alloc] initWithFrame:CGRectMake(0, 120, 100, 100)];

    bview.tintColor = [UIColor whiteColor];  //前景颜色

    bview.blurEnabled = YES;                //是否允许模糊,默认YES

    bview.blurRadius = 10.0;               //模糊半径

    bview.dynamic = YES;                   //动态改变模糊效果

    bview.iterations = 2;                  //迭代次数:

    bview.updateInterval = 2.0;            //更新时间(不确定具体功能)

    /*

     blurRadius = 1.0 && dynamic = 100 的效果和 blurRadius = 10.0 && dynamic = 1的效果大致相同

     */    

    [self.view addSubview:bview];

    

    FXBlurView * cview = [[FXBlurView alloc] initWithFrame:CGRectMake(150, 0, 200, 200)];

    cview.blurRadius = 20.0;

    cview.tintColor = [UIColor whiteColor];

    [self.view addSubview:cview];

}


demo下载:https://github.com/nicklockwood/FXBlurView

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值