NSBitmapImageRep - Fallback Background Color for JPEG output
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