设为首页 加入收藏

TOP

美图秀秀美化图片之【增强】模块界面与功能设计(五)
2017-10-12 12:09:18 】 浏览:1085
Tags:美图 美化 图片 增强 模块 界面 功能 设计
id)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unselectedImage方法用来设置FWEffectBarItem的被选中和未选中时的图片

title属性用来设置FWEffectBarItem的文字。

 

  二、UISlider的使用

UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(0, HEIGHT - 115 - 40, WIDTH, 40)];
    subview.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
    [self.view addSubview:subview];
    
    self.slider = [[FWSlider alloc] initWithFrame:CGRectZero];
self.slider.minimumValue
= -100; self.slider.maximumValue = 100; self.slider.value = 0; self.slider.frame = CGRectMake(WIDTH / 2 - 100, 10, 200, 20); [self.slider addTarget:self action:@selector(updateva lue:) forControlEvents:UIControlEventTouchUpInside]; [self.slider addTarget:self action:@selector(updateTipView:) forControlEvents:UIControlEventValueChanged]; [self.slider setThumbImage:[UIImage imageNamed:@"icon_slider_thumb"] forState:UIControlStateNormal]; [subview addSubview:self.slider];

 

setThumbImage用来设置滑块,该slider没有完全实现,当我们滑动的时候,没有显示当前值,有待改善

  

  四、FWBeautyProcessType枚举的定义

typedef NS_ENUM(NSInteger, FWBeautyProcessType)
{
    //智能优化
    FWBeautyProcessTypeAutoBeauty,
    //编辑
    FWBeautyProcessTypeEdit,
    //增强
    FWBeautyProcessTypeColorList,
    //特效
    FWBeautyProcessTypeFilter,
    //边框
    FWBeautyProcessTypeBolder,
    //魔幻笔
    FWBeautyProcessTypeMagicPen,
    //马赛克
    FWBeautyProcessTypeMosaic,
    //文字
    FWBeautyProcessTypeText,
    //背景虚化
    FWBeautyProcessTypeBlur
};

 

该枚举定义了【美化图片】下的所有功能模块,用于识别到底是哪种模块,不同模块相应的界面是不同的,请看下面代码

- (void)setupImageView
{
    if (self.type == FWBeautyProcessTypeAutoBeauty || self.type == FWBeautyProcessTypeColorList || self.type == FWBeautyProcessTypeEdit)
    {
        //105 = 设备高 - 关闭按钮高度 - 3段间距:30 - bar高度:55 - 的结果
        self.imageView.frame = CGRectMake(0, 0, WIDTH, HEIGHT - 115);
    }
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;

    [self.view addSubview:self.imageView];
}

//配置单选项卡
- (void)setupBar
{
    self.styleBar = [[FWEffectBar alloc] init];
    NSDictionary *autoDict = nil;
    
    if (self.type == FWBeautyProcessTypeAutoBeauty || self.type == FWBeautyProcessTypeColorList)
    {
        self.styleBar.frame = CGRectMake(0,HEIGHT - 105, WIDTH, 55);
        
        if (self.type == FWBeautyProcessTypeAutoBeauty )
            autoDict = [[FWCommonTools getPlistDictionaryForButton] objectForKey:@"AutoBeauty"];
        else
            autoDict = [[FWCommonTools getPlistDictionaryForButton] objectForKey:@"ColorValue"];
        
    }
    else if (self.type == FWBeautyProcessTypeEdit)
    {
        self.styleBar.frame = CGRectMake(100, HEIGHT - 55, 160, 55);
        
        autoDict = [[FWCommonTools getPlistDictionaryForButton] objectForKey:@"Edit"];
        
    }
    
    NSArray *normalImageArr = [autoDict objectForKey:@"normalImages"];
    NSArray *hightlightedImageArr = [autoDict objectForKey:@"HighlightedImages"];
    NSArray *textArr = [autoDict objectForKey:@"Texts"];
    
    NSMutableArray *arr = [[NSMutableArray alloc] initWithCapacity:0];
    for (int i = 0; i < [textArr count]; i++)
    {
        FWEffectBarItem *item = [[FWEffectBarItem alloc] initWithFrame:CGRectZero];
        [item setFinishedSelectedImage:[UIImage imageNamed:[hightlightedImageArr objectAtIndex:i]] withFinishedUnselected
首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇自定义进度条 下一篇UIButton

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目