开发者

How to erase lines from view by using eraser?

I am creating a view with multiples lines and some other shapes by using UI-Graphics-Get-Current-Context(). My application is similar to Paint. After drawing some lines and shapes when I try to erase them it removes all. Because in drawRect I had taken: UIGraphics-Begin-Image-Context(self.frame.size). self.frame.size creates drawing on whole frame. And I am deleting shapes by using:

for (UIView *view in self.subviews) {
    if(CGRect-ContainsPoint(view.frame, touch Location))
        [view removeFromSuperview];
}

This code deletes the other image View perfectly. But it deletes all lines without touching them (because the lin开发者_运维问答e view frame is self.frame).

How to change the frame of plotted lines after drawing?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜