• 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
Getting CGImage out of NSBitmapImageRep in 10.4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting CGImage out of NSBitmapImageRep in 10.4


  • Subject: Getting CGImage out of NSBitmapImageRep in 10.4
  • From: David Alter <email@hidden>
  • Date: Mon, 23 Feb 2009 13:51:14 -0800

I need to get a CGImage out of a NSBitmapImageRep. This needs to work in
10.4.
I tried doing this by setting the bitmap as the graphics context and then
creating the image form the context. This gives me an CGBitmapContextCreate:
unsupported parameter combination. Here is the code

NSGraphicsContext * context = [NSGraphicsContext
graphicsContextWithBitmapImageRep:offscreenRep];

CGContextRef bitmapContext = (CGContextRef)[context graphicsPort];

CGImageRef image = CGBitmapContextCreateImage (bitmapContext);

I suspect there is a better way to do this. Does anyone have any
suggestions.

enjoy
-dave
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: Getting CGImage out of NSBitmapImageRep in 10.4
      • From: Michael Ash <email@hidden>
  • Prev by Date: RE: Populating a new SQLite Core Data store with default data
  • Next by Date: Re: Changing the height of a NSTextField for editing
  • Previous by thread: Re: Changing the height of a NSTextField for editing
  • Next by thread: Re: Getting CGImage out of NSBitmapImageRep in 10.4
  • Index(es):
    • Date
    • Thread