• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
more efficient way to get CGImageRef from NSBitMapImageRep *
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSMutableDictionary Memory Question
  • Next by Date: Re: NSMutableDictionary Memory Question
  • Previous by thread: Re: NSMutableDictionary Memory Question
  • Next by thread: Core data question
  • Index(es):
    • Date
    • Thread