NSBitmapImageContext from Word *
NSBitmapImageContext from Word *
- Subject: NSBitmapImageContext from Word *
- From: David Kopec <email@hidden>
- Date: Thu, 9 Mar 2006 20:19:44 -0500
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