GithubHelp home page GithubHelp logo

chenxing640 / dyfblureffect Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 4.58 MB

`DYFBlurEffect`可以快速实现模糊图像,并支持系统 UIVisualEffectView。(Using DYFBlurEffect to quickly realize blurred image, and support UIVisualEffectView in iOS.)

Home Page: https://www.jianshu.com/p/2402dd3101cd

License: Other

Objective-C 94.17% Ruby 5.83%
ios objective-c uivisualeffectview cocoapods blur blurry blur-image blurred-image blurred-images blurring blurring-libraries

dyfblureffect's Introduction

如果此项目能帮助到你,就请你给一颗星。谢谢!

DYFBlurEffect

我们使用 DYFBlurEffect 可以快速实现模糊图像,并支持系统UIVisualEffectView

License MIT  CocoaPods  CocoaPods 

QQ群 (ID:614799921)

安装

使用 CocoaPods:

pod 'DYFBlurEffect', '~> 2.0.1'

预览

使用

  • 实例化
// Lazy load
- (DYFBlurEffect *)blurEffect {
    if (!_blurEffect) {
        _blurEffect = [[DYFBlurEffect alloc] init];
    }
    return _blurEffect;
}
  • 使用 CoreGraphics and vImage
// Uses a `DYFBlurEffectStyle` style.
self.imgView.image = [self.blurEffect blurryImage:image style:DYFBlurEffectLight];

// Tints with a color.
self.imgView.image = [self.blurEffect blurryImage:image tintColor:[UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:1]];
/**
Blur out an image with an original image, a blur radius, tint with a color, a saturation delta factor and a mask image.
*/
- (UIImage *)blurryImage:(UIImage *)image blurRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
  • 使用 UIVisualEffectView (Available iOS 8.0 or later)
UIVisualEffectView *blurView = [self.blurEffect blurViewWithStyle:UIBlurEffectStyleLight];
blurView.frame = self.imgView.bounds;
//blurView.tag = 10;
//blurView.userInteractionEnabled = YES;
[self.view addSubview:blurView];
  • 使用 CoreImage
 self.imgView.image = [self.blurEffect coreImage:image blurRadius:10];

示例

如需了解更多,请到这里

dyfblureffect's People

Contributors

itenfay avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

wynnforthework

dyfblureffect's Issues

pod安装不了

[!] Unable to find a specification for DYFBlurEffect
[!] Unable to find a specification for DYFBlurEffect (~> 2.0.0)

我的cocoapods 是1.6.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.