如何删除 NSBezierPath

发布于 2024-08-17 04:39:13 字数 82 浏览 2 评论 0原文

我创建了一个 NSBezierPath ,并在其上调用了 -lines 。如何在不取消分配对象的情况下从视图中删除/删除它?

I have an NSBezierPath that I created and I called -stroke on it. How do I remove/delete it from the view without deallocating the object?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失眠症患者 2024-08-24 04:39:13

-lines 消息告诉 NSBezierPath 在当前绘图上下文中渲染自身。如果您在视图中绘制了路径,并且希望描边路径消失,则只需重新绘制不带路径的视图即可。

A -stroke message tells the NSBezierPath to render itself in the current drawing context. If you've drawn a path in a view, and you want the stroked path to go away, just redraw the view without the path.

[旋木] 2024-08-24 04:39:13

如果你想暂时禁用绘图,可以在调用lines之前设置[NSColorclearColor]

If you want to temporary disable drawing, you can set [NSColor clearColor] before calling stroke.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文