2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > Aviary 滤镜 教程 照片编辑器

Aviary 滤镜 教程 照片编辑器

时间:2022-07-08 18:33:01

相关推荐

Aviary 滤镜 教程 照片编辑器

Aviary是一个国外的非常强大的照片编辑器,各种功能,但是是以静态库的形式存在的,不开源,但是很好用。

1.到官网上面下载sdk/AviaryInc/Mobile-Feather-SDK-for-iOS

2.把sdk整个文件添加到项目中,然后导入以下的framework

Accelerate.frameworkCoreData.frameworkCoreGraphics.frameworkFoundation.frameworklibsqlite3.0.dyliblibz.1.2.5.dylibQuartzCore.frameworkStoreKit.frameworkUIKit.frameworkCoreText.frameworkOpenGLES.framework

3.再target中的build setting中的linking栏目中找到Other Linker Flags然后添加

-ObjC -all_load -fobjc-arc

4.再需要进入编辑器的地方创建类的实例:

- (void)displayEditorForImage:(UIImage *)imageToEdit{AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];[editorController setDelegate:self];[self presentViewController:editorController animated:YES completion:nil];}

5.再编辑完成后会调用这个委托方法,在这个委托方法里面可以写对照片的进一步操作,

- (void)photoEditor:(AFPhotoEditorController *)editor finishedWithImage:(UIImage *)image{// Handle the result image here}- (void)photoEditorCanceled:(AFPhotoEditorController *)editor{// Handle cancelation here}

6.因为这个是静态库所以能改的东西很少,但是颜色还是可以改的

//设置编辑器的风格

AFPhotoEditorStyle *style = [editorController style];

UIColor *backgroundColor = [UIColor grayColor];

UIColor *foregroundColor = [UIColor whiteColor];

UIColor *accentColor = [UIColor grayColor];

[style setBackgroundColor:backgroundColor];

[style setAccentColor:accentColor];

[style setTopBarBackgroundColor:backgroundColor];

[style setTopBarTextColor:foregroundColor];

[style setTopBarLeftButtonBackgroundColor:backgroundColor];

[style setTopBarLeftButtonTextColor:foregroundColor];

[style setButtonIconColor:foregroundColor];

[style setButtonTextColor:foregroundColor];

7.好的,完毕。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。