I have been using

CGContextRef    context;        
context = CGBitmapContextCreate (m_bitmap.m_array.m_array, m_bitmap.m_array.m_pixelsx, m_bitmap.m_array.m_pixelsy, 8, m_bitmap.m_array.m_pixelsx * 4, colorSpace,kCGImageAlphaNoneSkipFirst| kCGBitmapByteOrder32Host);
CGImageRelease(m_BitmapImage);
CGContextRelease(context);
CGImageRetain(m_BitmapImage);

Then

CGContextDrawImage(cellViewContext, r, m_BitmapImage);

and all is well.


Now I use an NSBitMapImageRep and my colors are off

        m_ptrs[0] = (unsigned char*)m_bitmap.m_array;
        m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
                                                  
initWithBitmapDataPlanes:m_ptrs
                                                  pixelsWide:m_bitmap.m_pixelsx
                                                  pixelsHigh:m_bitmap.m_pixelsy
                                                  bitsPerSample:8
                                                  samplesPerPixel:3
                                                  hasAlpha:NO
                                                  isPlanar:NO
                                                  
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat| kCGBitmapByteOrder32Host
                                                  
bytesPerRow:(4*m_bitmap.m_pixelsx)
                                                  bitsPerPixel:32];
I am confused by this as m_bitmap.m_array is created identically in both examples
_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to