从 IKImageBrowserView 获取 CGImageRef
我向图像浏览器视图提供图像文件名,它会管理加载它们。
有没有办法在浏览器加载这些图像后检索这些图像的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能最简单的方法是使用 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.