more efficient way to get CGImageRef from NSBitMapImageRep *
more efficient way to get CGImageRef from NSBitMapImageRep *
- Subject: more efficient way to get CGImageRef from NSBitMapImageRep *
- From: Chris Ryland <email@hidden>
- Date: Fri, 23 Mar 2007 14:21:50 -0400
I've got the following (working) code that takes an active WebView
*webView and produces a CGImageRef cgImage:
WebView *webView;
...
NSBitmapImageRep *imageRep = [webView
bitmapImageRepForCachingDisplayInRect:[webView visibleRect]];
[webView cacheDisplayInRect:[webView visibleRect]
toBitmapImageRep:imageRep];
NSImage *image = [[NSImage alloc] initWithSize:[imageRep size]];
[image addRepresentation:imageRep];
CGImageRef cgImage = WebConvertNSImageToCGImageRef(image);
(using a WebKit utility conversion function in the last line).
I'm wondering if there's a more efficient way to get the CGImageRef
from the original NSBitMapImageRep object?
It *seems* like there should already be something very close to a
CGImage of some sort in the NSBitMapImageRep that one could convert
without going through the roundabout NSImage step.
Thanks for any ideas.
Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden