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

  • 相关阅读:
    P1182 数列分段Section II
    P1119 灾后重建
    P1133 教主的花园
    P1077 摆花
    P2002 消息扩散
    P2341 [HAOI2006]受欢迎的牛(tarjan+缩点)
    luoguP1726 上白泽慧音
    P1053 篝火晚会
    P2296 寻找道路
    P1156 垃圾陷阱
  • 原文地址:https://www.cnblogs.com/sanjianghuiliu/p/3663928.html
Copyright © 2020-2023  润新知