Re: Convert PICT to NSImage
Re: Convert PICT to NSImage
- Subject: Re: Convert PICT to NSImage
- From: "M. Uli Kusterer" <email@hidden>
- Date: Mon, 27 Jun 2005 23:01:16 +0200
At 9:34 Uhr -0700 27.06.2005, Ian was here wrote:
NSPICTImageRep *pictImage = [NSPICTImageRep
imageRepWithData:[NSData dataWithBytes:Pict
length:GetHandleSize( (Handle)Pict )]];
A Handle is a pointer to a pointer. You have to de-reference it once
to get at the actual bytes.
Also note that NSImage (as far as I've been able to find out so far)
doesn't honor the transparency information inside a PICT. If you need
that, you'll have to open an NSImage for drawing, get the Carbon
GrafPort for the current CGContext, use Quickdraw routines to fill it
with a color that isn't in the PICT and draw the PICT with
transparency, and then loop over the NSImage's pixels to turn all the
remaining colored pixels transparent.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden