On Mon, Dec 20, 2010 at 19:06, Alfred Van Hoek <[email protected]> wrote:
> Excellent,
>
> this means we don't need to worry with respect to the type of picture. And
> the code I posted earlier does show the picture in a textfield correctly, and
> I assume then that the current Error message with respect to the TIFF icc
> color will not show up in the console in release 2011. And reverting the
> Handle from a CGImageRef back to a REALpicture or CGImageRef is trivial and
> works fine as long as the REALpicture was converted to a TIFFRepresentation.
> Note that I am not interested in a true PicHandle with a 512 byte header,
> just the data as a TIFF representation, which needs to be put into a Handle,
> not a pointer.
>
> Thanks for the response, seems like we are moving forward rather quickly.
>
> Alfred
You might consider just using ImageIO to create the TIFF data, instead
of going up in to AppKit. It might be faster, and I find it a lot
cleaner. For example:
CFDataRef CreateTIFF(REALpicture myPicture) {
CGImageRef image = REALCopyPictureCGImage(myPicture);
CFMutableDataRef data = CFDataCreateMutable( NULL, 0 );
CGImageDestinationRef dest = CGImageDestinationCreateWithData( data,
kUTTypeTIFF, 1, NULL );
CGImageDestinationAddImage( dest, image, NULL );
CGImageDestinationFinalize( dest );
CFRelease( dest );
CFRelease( image );
return data;
}
--
Joe Ranieri
Mac Frameworks & Compiler Engineer
REAL Software, Inc.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>