• 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
NSBitmapImageRep - Fallback Background Color for JPEG output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBitmapImageRep - Fallback Background Color for JPEG output


  • Subject: NSBitmapImageRep - Fallback Background Color for JPEG output
  • From: Jakob Weick <email@hidden>
  • Date: Sun, 13 Dec 2009 13:40:13 +0100

Hello,

Leopard introduced a new NSBitmapImageRep attribute NSImageFallbackBackgroundColor. I often use it in my applications. Now in Snow Leopard this option does not work anymore. Also the equivalent option in the ImageIO framework kCGImageDestinationBackgroundColor is useless. Here is some code:

NSData *dt = [mBitmapRep representationUsingType:NSJPEGFileType properties:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:0.7], NSImageCompressionFactor, [NSColor blackColor], NSImageFallbackBackgroundColor, nil]];

[dt writeToFile:@"MyImage.jpg" atomically:NO];

I need a black fallback color, not the white default background color.

Any ideas? Thank you.

Jakob

_______________________________________________

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

  • Prev by Date: Core Data - Importing using NSOperation - Problems on main thread
  • Next by Date: NSTableView, NSDateFormatter, CoreData
  • Previous by thread: Re: Core Data - Importing using NSOperation - Problems on main thread
  • Next by thread: NSTableView, NSDateFormatter, CoreData
  • Index(es):
    • Date
    • Thread