If David Duncan would comment on performance issues using his suggested approach:

        CGColorSpaceRef colorSpace;
        colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
CGDataProviderRef provider = CGDataProviderCreateWithData (NULL,m_bitmap.m_array, 4*m_bitmap.m_pixelsx*m_bitmap.m_pixelsy, NULL);
        CGImageRelease(m_CGImageRef);
m_CGImageRef = CGImageCreate(m_bitmap.m_pixelsx, m_bitmap.m_pixelsy, 8, 32, 4*m_bitmap.m_pixelsx, colorSpace, kCGImageAlphaNoneSkipFirst| kCGBitmapByteOrder32Host, provider, NULL,YES, kCGRenderingIntentDefault);
        CGImageRetain(m_CGImageRef);
        CGColorSpaceRelease(colorSpace);
        CGDataProviderRelease(provider);

Clearly I have kicked NSBitMapImageRep under the bus as the above gives what I am looking for.

The performance issue comes from the fact the user will be dragging this bitmap around so I a regenerating m_bitmap.m_array constantly.

Thanks for all the help ... I think I have learned something!

db
_______________________________________________

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