使用UIBezierPath擦除线图 [英] Erase line drawing with UIBezierPath

查看:215
本文介绍了使用UIBezierPath擦除线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用UIBezierPath绘制一个简单的应用程序,但现在需要一种方法来擦除用UIBezierPath绘制的线。有没有办法删除线条画的橡皮擦功能?

Did a simple application for line drawing with UIBezierPath, but now need a way to erase the line drawn with UIBezierPath. Is there a way to implement eraser feature for removing the line painting?

推荐答案

如果你使用图像作为背景,设置相同的图像作为画笔图案绘制bezierpath它会实际上给你的橡皮擦效果。它适用于我。 :)

If you are using an image as background then you can set the same image as brush pattern to draw the bezierpath it will virtually give you the eraser effect. It works for me. :)

    brushPattern=[[UIColor alloc]initWithPatternImage:[UIImage imageNamed:@"image.jpg"]];
    // Here image.jpg is you background image

这篇关于使用UIBezierPath擦除线图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆