Re: NSBitmapImageContext from Word *
Re: NSBitmapImageContext from Word *
- Subject: Re: NSBitmapImageContext from Word *
- From: Greg Best <email@hidden>
- Date: Fri, 10 Mar 2006 02:01:13 -0800
Is it because you have bitsPerSample=5, samplesPerPixel=3 and
bitsPerPixel=16?
On Mar 9, 2006, at 5:19 PM, David Kopec wrote:
Hi everyone,
I'm attempting to put
WORD *WorkFrame;
which points to
WORD DoubleFrame[ 2 ][ NES_DISP_WIDTH * NES_DISP_HEIGHT ];
in which the pixels are stored like this:
Since Array WorkFrame stores the screen information (256x240) in
16-bit pallet format (5-5-5), it must be transformed and
displayed in the format of the target machine.
into an NSBitmapImageContext using the following:
NSBitmapImageRep *ir = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:(unsigned char **)WorkFrame
pixelsWide:NES_DISP_WIDTH pixelsHigh:NES_DISP_HEIGHT
bitsPerSample:5
samplesPerPixel:3 hasAlpha:NO isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bytesPerRow:NES_DISP_WIDTH*2 bitsPerPixel:16];
All I'm getting is blankness and "Inconsistent set of values to
create NSBitmapImageRep"
Any help much appreciated. Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden