刮奖效果

简介:

刮奖效果

 

效果

 

说明

刮奖效果使用了开源的 Scatch & See 控件.

 

源码

https://github.com/YouXianMing/Animations

https://github.com/moqod/iOS-Scratch-n-See



//
//  ScratchImageViewController.m
//  Animations
//
//  Created by YouXianMing on 15/12/22.
//  Copyright © 2015年 YouXianMing. All rights reserved.
//

#import "ScratchImageViewController.h"
#import "MDScratchImageView.h"
#import "UIView+SetRect.h"
#import "UIImage+ImageEffects.h"

@interface ScratchImageViewController ()

@end

@implementation ScratchImageViewController

- (void)setup {

    [super setup];
    
    self.titleView.backgroundColor       = [UIColor whiteColor];
    self.contentView.layer.masksToBounds = YES;
    
    UIImage *image = [UIImage imageNamed:@"1"];
    
    // 背景图片
    UIImageView *blurImageView = [[UIImageView alloc] initWithFrame:(CGRect){CGPointZero, image.size}];
    blurImageView.image        = image;
    blurImageView.center       = self.contentView.middlePoint;
    [self.contentView addSubview:blurImageView];
    
    // 被刮的图片
    MDScratchImageView *scratchImageView = [[MDScratchImageView alloc] initWithFrame:blurImageView.frame];
    [scratchImageView setImage:[image blurImage] radius:20.f];
    [self.contentView addSubview:scratchImageView];
}

@end

细节

 

目录
相关文章
|
9月前
|
JavaScript 前端开发
植物大战僵尸Javascript版web游戏源码
植物大战僵尸Javascript版web游戏源码,非常强大,1比1还原电脑版植物大战僵尸游戏,带背景音乐,玩法和原版一模一样。
343 2
|
测试技术 芯片 内存技术
DDR3基本知识及测试【转】
转自:http://blog.csdn.net/myarrow/article/details/7847385 一、DDR3简介       DDR3(double-data-rate three synchronous dynamic random access memory)是应用在计算机及电子产品领域的一种高带宽并行数据总线。
1101 0
|
Java
[LeetCode]--58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. If the last word does not exist, return 0. Note: A wo
1280 0
|
前端开发
超精美!10款专业的高质量名片设计模板
  名片,中国古代称名刺,是标示姓名及其所属组织、公司单位和联系方法的纸片。名片也是新朋友互相认识、自我介绍的最快有效的方法。下面的列表向大家分享10款专业的高质量名片设计模板。 您可能感兴趣的相关文章 名片制作:25款现代风格名片设计示例 创意无限:25款精美高档名片设计欣赏 分享5...
1147 0
|
SQL 监控 关系型数据库
将MySQL-mmm Master从REPLICATION_FAIL状态恢复
        估计是糗百看多了,总是先要交待一下背景。         几天前网站突然不能访问了,页面上除了框架没有任何内容。从系统的运行日志看到的错误信息有: Communications link failure The last packet successfully received from the server was 7,875,055 milliseconds ago.
1190 0
|
机器学习/深度学习
数据结构实验之链表七:单链表中重复元素的删除
数据结构实验之链表七:单链表中重复元素的删除 Time Limit: 1000MS Memory Limit: 65536KB Problem Description 按照数据输入的相反顺序(逆位序)建立一个单链表,并将单链表中重复的元素删除(值相同的元素只保留最后输入的一个)。
1536 0

热门文章

最新文章