views:

198

answers:

1

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.

+1  A: 

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.

Christopher Lloyd
Thanks. It sounds like it will give me a thumbnail-sized image, rather than the original full size image. Is it correct?
thesamet