Copyright 2004 by M. Uli Kusterer Fri, 29 Nov -1901 11:06:32 GMT Comments on article blog-screen-shots-on-the-mac at Zathras.de http://www.zathras.de/angelweb/blog-screen-shots-on-the-mac.htm blog-screen-shots-on-the-mac Comments witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) en-us Comment 2 by Uli Kusterer http://zathras.de/angelweb/blog-screen-shots-on-the-mac.htm#comment2 http://zathras.de/angelweb/blog-screen-shots-on-the-mac.htm#comment2 Uli Kusterer writes:
It's not the alpha-first that causes the problem. It's the order of the R and B color components (or rather, the byte-order of the pixel data). The pixel data GCDirectDisplay gives you is little-endian, while Cocoa seems to be hard-coded to big-endian for backwards compatibility.
Comment 1 by ken http://zathras.de/angelweb/blog-screen-shots-on-the-mac.htm#comment1 http://zathras.de/angelweb/blog-screen-shots-on-the-mac.htm#comment1 NSBitmapImageRep can deal directly with alpha first data. Pass NSAlphaFirstBitmapFormat as the bitmapFormat argument to the most massive init method (longest method in Cocoa!).