开发者

How to clear and then redraw a quartz drawing

开发者 https://www.devze.com 2022-12-09 07:24 出处:网络
I\'m making a complex drawing using quartz based on passed in information.The only part I haven\'t been able to figure out is how do I clear the lines, rectangles, etc th开发者_运维问答at I\'ve alread

I'm making a complex drawing using quartz based on passed in information. The only part I haven't been able to figure out is how do I clear the lines, rectangles, etc th开发者_运维问答at I've already drawn? Basically, I want to erase the whole drawing and just draw it again from the new data.


If you set your UIView's clearContextBeforeDrawing property to YES, then the system should take care of filling its area with its backgroundColor before calling its drawRect: method.


If you want to clear something that's not tracked as part of the current state, it's probably less expensive to just release your old context and start a new one.

0

精彩评论

暂无评论...
验证码 换一张
取 消