zoukankan      html  css  js  c++  java
  • Aviary 滤镜 教程 照片编辑器

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

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

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

    Accelerate.framework
    CoreData.framework
    CoreGraphics.framework
    Foundation.framework
    libsqlite3.0.dylib
    libz.1.2.5.dylibQuartzCore.framework
    StoreKit.framework
    UIKit.framework
    CoreText.framework
    OpenGLES.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.好的,完毕。

  • 相关阅读:
    Unity3D 系统宏
    Mac OS—苹果搭建Android开发环境
    CocoaChina六年了,记我的这六年——六年汇总
    我的程序员之路(8)——北京第三家公司工作第一年总结
    Unity插件研究院之ResourceChecker
    Unity3D 插件大全
    MAC中开发Unity3D
    MySql安装过程(以验证)【网络资料】
    .net—— webservice的新建、发布、使用(最全、最简单)【原创】
    EF 链接MySql 建立数据模型
  • 原文地址:https://www.cnblogs.com/sanjianghuiliu/p/3663928.html
Copyright © 2011-2022 走看看