从IKImageBrowserView获取CGImageRef

时间:2009-05-01 06:08:46

标签: cocoa core-animation core-image

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

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

1 个答案:

答案 0 :(得分:1)

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

-bitmapImageRepForCachingDisplayInRect:

为该区域构建NSBitmapImageRep,然后

-cacheDisplayInRect:toBitmapImageRep:

进入它,然后是NSBitmapImageRep的

-CGImage

获取CGImageRef的方法。