Re: Cocoa and PICT
Re: Cocoa and PICT
- Subject: Re: Cocoa and PICT
- From: Uli Kusterer <email@hidden>
- Date: Fri, 10 Aug 2007 16:22:24 +0200
On 10.08.2007, at 16:02, I. Savant wrote:
Now *this* bothers me. The existing version of this application,
which uses PowerPlant, yields only one pasteboard type: PICT. There
*is* "transparency", though there may be a slight difference in
definition: I mean anywhere there *isn't* drawing is "transparent" (no
fill in the background). I *don't* mean "a translucent pie graph",
those tend not to print well anyway. ;-)
Given that distinction, can you be more specific about the
limitations you mentioned?
Alpha transparency as he referred to, which Quickdraw only sort-of-
does, has different levels of transparency (or levels of opacity),
so, stuff appears to be showing through another object, which appears
to be made e.g. of colored plastic. Quickdraw is a vector format, so
it does have the notion of "Here is an object" and "Here are no
objects, and any background will show through".
You could just use Quickdraw calls to render your PICT into a
CGContext that you've cleared to transparent using Quartz. The pixels
Quickdraw didn't touch should stay transparent, and you could
probably then create an NSImage from that pixel data. I think this
worked last I tried it. Should Quickdraw clear out the whole rect of
the PICT after all, you could simply erase the whole canvas to some
color that isn't in the image, and then postprocess the NSImage to
set the alpha of those pixels to 0 afterwards.
But as you notice, that means you'll still be using deprecated
Quickdraw calls. If you want to support PICT beyond that, you'll have
to write code to parse and render PICT yourself, I'm afraid. There
are apps that did that before. Reso(u?)rcerer for one can parse
PICTs, maybe you can license the code?
I guess there's no way to change that other app to not output PICT,
and instead use Quartz and generate PDFs or so?
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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