标签:
demo地址:http://code4app.com/ios/UIImage-Helpers/52c502b6cb7e84a81a8b558c
1、模糊图片:
#import "UIImage+Blur.h"
...
// jpeg quality image data
float quality = .00001f;
// intensity of blurred
float blurred = .5f;
NSData *imageData = UIImageJPEGRepresentation([self.imageViewNormal image], quality);
UIImage *blurredImage = [[UIImage imageWithData:imageData] blurredImage:blurred];
self.imageViewBlurred.image = blurredImage;
2、屏幕截图:
#import "UIImage+Screenshot.h"
...
UIImage *image = [UIImage screenshot];
self.imageView.image = image;
3、根据颜色生成图片:
#import "UIImage+ImageWithColor.h"
...
UIColor *purpleColor = [UIColor colorWithRed:.927f green:.264f blue:.03f alpha:1];
UIImage *image = [UIImage imageWithColor:purpleColor];
[self.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
UIImage-Helpers截屏、毛玻璃(模糊)以及根据颜色生成图片
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4473911.html