On Jan 6, 2010, at 9:21 AM, David Blanton wrote:

>       m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
>                                                  
> initWithBitmapDataPlanes:m_ptrs
>                                                  
> pixelsWide:m_frameRect.size.width
>                                                  
> pixelsHigh:m_frameRect.size.height
>                                                  bitsPerSample:8
>                                                  samplesPerPixel:4
>                                                  hasAlpha:YES
>                                                  isPlanar:NO
>                                                  
> colorSpaceName:NSCalibratedRGBColorSpace
>                                                  
> bitmapFormat:NSAlphaFirstBitmapFormat
>                                                  bytesPerRow:(4 * 
> m_frameRect.size.width)
>                                                  bitsPerPixel:32];

This code creates a bitmap with alpha.

>       context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx, 
> bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, 
> kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host); 

This code creates a bitmap without alpha.

> The problem is I just see garbage, no image.  Clearly I am doing something 
> wrong with the NSBitMapImageRep but I have no idea what.


Hence garbage.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to