Tiger 上的 NSGradient

发布于 2025-01-07 16:30:15 字数 144 浏览 4 评论 0原文

我正在创建一个必须在 Tiger 上运行的应用程序,并且我需要在 NSView 上绘制渐变。不幸的是,NSGradient 仅适用于 Leopard 及以上版本。谷歌根本不是我的朋友。如何在 Mac OS X 10.4 上为 NSView 绘制渐变?

谢谢!

I'm creating an app that must run on Tiger and I need to draw a gradient onto a NSView. Unfortunately, NSGradient is only available on Leopard and above. Google wasn't my friend at all. How do I draw a gradient to a NSView on Mac OS X 10.4?

Thanks!

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

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

发布评论

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

评论(2

风苍溪 2025-01-14 16:30:15

在 Apple 推出 NSGradientCTGradient代码>.它是 CGShading C API 的包装器。

A lot of developers used CTGradient before Apple introduced NSGradient. It's a wrapper around the CGShading C API.

两人的回忆 2025-01-14 16:30:15

您将需要使用 CGShading对象来绘制渐变,并自己为其编写插值函数(Quartz 2D 编程指南)。

You will need to use a CGShading object to draw the gradient, and write the interpolation function for it yourself (an example is given in the Quartz 2D Programming Guide).

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