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.好的,完毕。

  • 相关阅读:
    Task 和 Function
    FPGA中双向端口的设计原理及仿真
    EDK实用实例之LED
    分频电路设计(笔记)
    你了解Promise么
    配置vue多页
    Chrome控制台console的那些属性
    关于读书
    django常用命令
    django 简易博客开发 2 模板和数据查询
  • 原文地址:https://www.cnblogs.com/sanjianghuiliu/p/3663928.html
Copyright © 2011-2022 走看看