如今对个人图片的美化可所谓,天花乱醉。今天,就和大家一起进入一个美丽的世界。
第一步:首先,了解一个重要的知识,如下:
UIImage和UIView使用的是左上原点坐标,Core Image和Core Graphics使用的是左下原点坐标
第二部:效果图预览。
#import "ViewController.h"
@interface ViewController ()
{
@protected
//创建图像上下文
CIContext * Context ;
// 创建显示图片的控件
UIImageView * ImageV;
//我们要处理的图像
CIImage * WillDoImage;
//处理后,我们得到的图像
CIImage * OutImage;
//添加滤镜镜头
CIFilter * Filter_zsj;
@public
// 滤镜功能背景图
UIView * View ;
}
@property(nonatomic,strong) NSMutableArray * AllPointArray;
// 标记是否可以涂鸦
@property(nonatomic,assign) BOOL TuYaBool;
//系统暂时图像
@property(nonatomic,strong) UIImage * Temp_Image;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.AllPointArray = [NSMutableArray arrayWithCapacity:0];
self.Temp_Image = [UIImage imageNamed:@"4673e28380ac5b03ab2f8da9bb78d9e4.jpg"];
[self loadNav];
[self makeUI];
// 创建滤镜的功能按钮
[self filterBtn];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)loadNav{
UILabel * Nav_Label = [[UILabel alloc]initWithFrame:CGRectMake(self.view.bounds.size.width/2-100, 20, 200, 44)];
Nav_Label.textAlignment = NSTextAlignmentCenter;
Nav_Label.text = @"成功QQ吧提供--滤镜";
Nav_Label.textColor = [UIColor magentaColor];
Nav_Label.font = [UIFont fontWithName:@"" size:22];