Re: nil there not here
Re: nil there not here
- Subject: Re: nil there not here
- From: David Duncan <email@hidden>
- Date: Tue, 28 Jul 2009 10:37:53 -0700
On Jul 27, 2009, at 2:44 PM, David Blanton wrote:
context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx,
bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace,
kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);
CGImageRelease(_myDocumentView->_cgImageRef);
_myDocumentView->_cgImageRef = CGBitmapContextCreateImage (context);
CGImageRetain(_myDocumentView->_cgImageRef);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
This is also over-retaining the CGImage. However you may want to
consider creating a CGImage directly instead of going through a bitmap
context, as this gives you more flexibility in what types of image
data you can represent, as well as avoiding a trip through the kernel
to mark the memory for the bitmap context as copy-on-write.
--
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