从 IKImageBrowserView 获取 CGImageRef

发布于 2024-07-19 05:58:28 字数 105 浏览 5 评论 0原文

我向图像浏览器视图提供图像文件名,它会管理加载它们。

有没有办法在浏览器加载这些图像后检索这些图像的 CGImageRef ? 当用户单击图像时,我想用它们做一些核心动画。

I feed the image browser view with image filenames and it manages loading them.

Is there a way to retrieve the CGImageRef of those images from the browser after it loads them? I'd like to do some Core Animation with them when the user clicks on an image.

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

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

发布评论

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

评论(1

空袭的梦i 2024-07-26 05:58:28

可能最简单的方法是使用 NSView 方法

-bitmapImageRepForCachingDisplayInRect:

为该区域构建 NSBitmapImageRep,然后

-cacheDisplayInRect:toBitmapImageRep:

绘制到其中,然后使用 NSBitmapImageRep 的

-CGImage

方法获取 CGImageRef。

Probably the simplest way to do this is to use the NSView method

-bitmapImageRepForCachingDisplayInRect:

to build an NSBitmapImageRep for the area, then

-cacheDisplayInRect:toBitmapImageRep:

to draw into it, then NSBitmapImageRep's

-CGImage

method to get a CGImageRef.

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