如何清除 iPad 上的屏幕或画布?
我需要在我的应用程序中实现一个选项来清除屏幕。该应用程序基本上是为了实现徒手绘图。请帮助我如何清除绘图画布。为此我需要一个按钮。 谢谢。
I need to implement an option in my application that will clear the screen. The application is basically to acheive free-hand drawing. Please help me on how to clear the drawing canvas. I need to have a button for that purpose.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
清除画布取决于您的绘图方式。如果您使用矢量进行绘图(例如保存触摸点,然后在它们之间绘制线条),那么您只需删除绘图中的所有线条或点并重新绘制画布即可。如果您直接绘制某些位图,则只需在整个画布上绘制填充矩形即可清除画布。另请参阅我对相关问题的回答关于绘图表示。
Clearing the canvas depends on how you do the drawing. If you are drawing using vectors (like saving touch points and then drawing lines between them), then you can simply delete all the lines or points in your drawing and redraw the canvas. If you are drawing directly to some bitmap, you can clear the canvas simply by drawing a filled rectangle over the whole canvas. See also my answer to a related question regarding the drawing representation.