Re: Using NSImage/NSBitmapImageRep stuff in command line tools
Re: Using NSImage/NSBitmapImageRep stuff in command line tools
- Subject: Re: Using NSImage/NSBitmapImageRep stuff in command line tools
- From: Andrew Platzer <email@hidden>
- Date: Wed, 29 Oct 2003 11:04:36 -0800
On Sep 30, 2003, at 6:10 AM, Florent Pillet wrote:
Hmm after checking the archives, it looks like I'm hitting the
"NSBMPFileType doesn't really work" problem. If I get a NSPNGFileType
representation, everything works fine. However, NSBMPFileType always
return nil. Grr.
The BMP creation code is very limited. Make sure the bitmap is 8 bit
RGB or greyscale, no alpha, no extra components, non-planar.
-initWithFocusedViewRect: may return an image with an alpha channel and
if so, the conversion to BMP won't work and you'll get NULL back. If
there is alpha, allocate a new NSBitmapImageRep and copy over just the
RGB values.
Alternatively, the BMP format is quite simple and you could write it
out yourself especially if you use 8 bit samples.
Andrew
_______________________________
Andrew Platzer
Application Frameworks
Apple Computer, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.