Re: NSBitMapImageRep Woes
Re: NSBitMapImageRep Woes
- Subject: Re: NSBitMapImageRep Woes
- From: David Duncan <email@hidden>
- Date: Wed, 6 Jan 2010 09:35:43 -0800
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 (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