iOS_23_undress Girl
最后效果图:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcHJlX2VtaW5lbnQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
关键代码例如以下:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcHJlX2VtaW5lbnQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">
//
// BeyondViewController.h
// 24_showGirl
//
// Created by beyond on 14-8-26.
// Copyright (c) 2014年 com.beyond. All rights reserved.
// #import <UIKit/UIKit.h> @interface BeyondViewController : UIViewController
@property (nonatomic,weak) IBOutlet UIImageView *clothes;
@end
//
// BeyondViewController.m
// 24_showGirl
//
// Created by beyond on 14-8-26.
// Copyright (c) 2014年 com.beyond. All rights reserved.
// #import "BeyondViewController.h" @interface BeyondViewController ()
{
BOOL canEarse;
} @end @implementation BeyondViewController
// 触摸開始
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
// 假设触摸点落在ClothesImgView上面
if([touch view]==_clothes)
{
canEarse = YES;
} }
// 触摸进行中
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
if(canEarse)
{
// 获得触摸点的坐标
CGPoint currentPoint = [touch locationInView:_clothes];
// 开启上下文
UIGraphicsBeginImageContext(self.clothes.frame.size);
// 将原图画到上下文中,以便进行像素处理
[_clothes.image drawInRect:_clothes.bounds];
// 清除触摸点附近区域的一些像素
CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(currentPoint.x, currentPoint.y, 30, 30));
// 又一次画上去
_clothes.image = UIGraphicsGetImageFromCurrentImageContext();
// 关闭上下文
UIGraphicsEndImageContext();
}
}
// 触摸结束
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
canEarse = NO; }
@end
版权声明:本文博客原创文章。博客,未经同意,不得转载。
iOS_23_undress Girl的更多相关文章
随机推荐
- nginx conf by linux kernel
#nginx conf by linux kernel net.ipv4.tcp_max_tw_buckets = 6000 net.ipv4.ip_local_port_range = 1024 6 ...
- [2011山东ACM省赛] Identifiers(模拟)
Identifiers Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 Identifier is an important ...
- 学习英语每日一 On the house. 赠品
tp=webp" alt=""> On the house. 免费赠送.我们之前学过请客能够说I'll buy you something. 事实上还有一种说法是I ...
- linux网络编程投票
投票系统 1.说明: 写了一个投票系统.过程是先配置好server,在写一个网上投票功能.要实现网上投票功能. 事实上功能实现还是非常easy的,麻烦一点的在于过程比較繁杂,要做的东西还是挺多的. 2 ...
- 王立平--result += "{";
result += "{"; 等于:result=result+"{" 字符串连接 x+=1====x=x+1 版权声明:本文博客原创文章,博客,未经同意,不得 ...
- JavaEE(4) - JMS实现企业PTP消息处理
1. 在Weblogic服务器上配置PTP消息目的 配置持久化: Services-->Persistence Stores-->New(Create FileStore, Create ...
- Go如何使用实现继承的组合
Go它提供了一个非常值得称道的并发支持,但Go它不支持完全面向对象的.这并不意味着Go不支持面向对象,,和Go的OO系统做的很轻巧,学习降至最低成本.向对象让Go失去了一些OO的方便特性,可是更高的效 ...
- 允许Android随着屏幕转动的控制自由转移到任何地方(附demo)
在本文中,Android ViewGroup/View流程,及经常使用的自己定义ViewGroup的方法.在此基础上介绍动态控制View的位置的三种方法,并给出最佳的一种方法. 一.ViewGroup ...
- 组合数处理(逆元求解)...Orz
网上发现了不错的博客讲解... 熊猫的板子:http://blog.csdn.net/qq_32734731/article/details/51484729 组合数的预处理(费马小定理|杨辉三角|卢 ...
- 图片 Base64码 转换
import sun.misc.BASE64Decoder; private String getBase64Picture(String imgBase64Str) { FileOutputStre ...