最后效果图:

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的更多相关文章

随机推荐

  1. 2014ACM上海邀请赛A解释称号

    #include <cstdio> #include <cstring> #include <iostream> using namespace std; cons ...

  2. CGI原理解析系列之中的一个----CGI怎样获取WEBserver数据

    //gcc get_post.c -o get_post.ums; #include <stdio.h> #include <stdlib.h> #include <un ...

  3. net中使用ETW事件

    在.net中使用ETW事件的方法   直到.net4.5,才有了比较便利的操作ETW的方法. 本文介绍的方法主要来源于Microsoft.Diagnostics.Tracing.TraceEvent官 ...

  4. 实例教程Unity3D单例模式(一)通经常使使用方法

    unity3d教程 中的单例模式通经常使使用方法 通经常使使用方法是在相关类增加GetInstance()的静态方法,检查实例是否存在.假设存在,则返回.假设不存在.则返回一个"须要用游戏元 ...

  5. .Net async

    概述 先吐个槽,.NET的TPL框架,以及这篇文章想要表述的async await关键字,都是.NET语言层面本身支持的一种异步框架,代表其在编译时是可以最大化的被优化,作为内部DSL来说,.NET一 ...

  6. ANDROID嵌入式应用Unity3D视图(画廊3D模型)

    转载请注明来自大型玉米的博客文章(http://blog.csdn.net/a396901990),谢谢支持! 效果展示:   watermark/2/text/aHR0cDovL2Jsb2cuY3N ...

  7. oracle connect by 说明

    Oracle能够通过START WITH . . . CONNECT BY . . .子句来实现SQL分层查询,这递归查询 例如: select level||'月' 月份 from dual con ...

  8. java 它 引用(基本类型的包装,构造函数和析构函数c++不同)

      一个:java 和c++参考控制 他提到引用,我们会想到java它不喜欢c++里面的指针.当然java内引用和c++里面的引用是不同的. 比如: 比方C++中,我对某一个函数的声明.int a(i ...

  9. Instll meld in windows

    在linux下用meld感觉颇为不错,但是在windows上真是折腾老久.p4merge也试了试, 但还是meld用起来更顺手. 使用 https://wiki.gnome.org/Meld/Wind ...

  10. CODE - TSQL convert Query to JSON

    原文 ODE - TSQL convert Query to JSON TSQL - Query to JSON It is my philosophy that good development s ...