- CFMutableDataRef data = CFDataCreateMutable(kCFAllocatorDefault, 0);
- CGImageDestinationRef destination = CGImageDestinationCreateWithData( data , kUTTypeTIFF , 1 , NULL );
- if ( destination )
- {
- CGImageDestinationAddImage( destination, cgImageRef, NULL );
- CGImageDestinationFinalize( destination );
- CFRelease( destination );
- }
- m_pictHandle = NewHandle(CFDataGetLength(data));
- if ( m_pictHandle )
- {
- memcpy( *(Handle)m_pictHandle, (const char *)CFDataGetBytePtr(data), CFDataGetLength(data) );
- }
- CFRelease( data );
+ CGImageDestinationAddImage( destination, cgImageRef, NULL );
+ CGImageDestinationFinalize( destination );
+ CFRelease( destination );