Answered my own question ... apologize for the noise!
On Jan 7, 2010, at 4:05 PM, David Blanton wrote:
Thanks to all.
I have my bitmap being drawn but it is upside down.
Do isFlipped play any role in this / how do I get it to draw right
side up without inverting my raw data?
For those inte
Thanks to all.
I have my bitmap being drawn but it is upside down.
Do isFlipped play any role in this / how do I get it to draw right
side up without inverting my raw data?
For those interested this is the correct definition of NSBitMapImageRep:
m_ptrs[0] = (unsigned char*)m_bitmap.
On 07/01/2010, at 4:21 AM, David Blanton wrote:
> bytesPerRow:(4 *
> m_frameRect.size.width)
> bitsPerPixel:32];
Apart from what others have said, you can pass 0 for these parameters and they
get
On Jan 6, 2010, at 10:19 AM, David Blanton wrote:
> Now, from David Duncan's comment.
>
> My bitmap data does have alpha, i.e 4 samples per pixel ARGB. I thought
> kCGImageAlphaNoneSkipFirst says don't make an alpha plane, skip byte 1 and go
> to RED.
>
> I am not sure how to specify this in
OK.
So, from other comments I made some changes.
1. Correctly set the dimensions by using m_bitmap.m_pixelsx and
m_bitmap.m_pixelsy (these are members of our portable bitmap class).
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
ini
On Jan 6, 2010, at 9:21 AM, David Blanton wrote:
> Here is the code:
>
> @interface MyDocumentView : NSView {
> @public
>
> NSBitmapImageRep* m_NSBitmapImageRep;
> NSRect m_frameRect;
> float m_sz;
> BBitmap
On Jan 6, 2010, at 11:21 AM, David Blanton wrote:
> - (void)drawRect:(NSRect)dirtyRect {
>
> [NSGraphicsContext saveGraphicsState];
> [m_NSBitmapImageRep drawInRect:dirtyRect];
> [NSGraphicsContext restoreGraphicsState];
> }
The docs for -drawInRect: say i
On Jan 6, 2010, at 9:21 AM, David Blanton wrote:
> m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
>
> initWithBitmapDataPlanes:m_ptrs
>
> pixelsWide:m_frameRect.size.width
>