【问题标题】:Getting a CGImageRef from IKImageBrowserView从 IKImageBrowserView 获取 CGImageRef
【发布时间】:2009-05-02 00:05:25
【问题描述】:

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

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

【问题讨论】:

    标签: cocoa core-animation core-image


    【解决方案1】:

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

    -bitmapImageRepForCachingDisplayInRect:

    为该区域构建一个 NSBitmapImageRep,然后

    -cacheDisplayInRect:toBitmapImageRep:

    画进去,然后是NSBitmapImageRep的

    -CGImage

    获取 CGImageRef 的方法。

    【讨论】:

    • 谢谢。听起来它会给我一个缩略图大小的图像,而不是原始的全尺寸图像。对吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-08
    相关资源
    最近更新 更多