Re: getting path info from PDF image?
Re: getting path info from PDF image?
- Subject: Re: getting path info from PDF image?
- From: Joe <email@hidden>
- Date: Tue, 16 Oct 2001 19:22:09 -0500
Hey Marcel,
Thanks for writing. Your information was very helpful.
I guess the thing I need most is the ability to generate an alpha mask
from a PDF file. For example, let's say my PDF file is an icon that looks
like a star, I need to be able to determine if the user clicks inside the
bounds of the star, or outside. I seem to recall this was easy in OS 9.
I guess I should draw the PDF into an NSBitmapImageRep and look at the
alpha channel data through the bitmapData method? Or is there an better
way to determine if a point lies inside or outside of an images' alpha
channel?
-Joe
On Tuesday, October 16, 2001, at 01:36 PM, Marcel Weiher wrote:
On Monday, October 15, 2001, at 02:04 AM, Joe wrote:
I've written a program which loads and displays a small PDF image in an
NSView. It's a small circular icon.
I'd like to be able to generate an NSBezierPath of its outline,
If you you're thinking about getting the path data encoded in the PDF:
no dice. Although Apple obviously has this data in Quartz someplace,
there is no API for getting at it. All you can do with a PDF is render
it or embed in another PDF.
so I can draw a beautiful pulsating curvy outline around this image.
Actually, I want to do a lot of different things with the image data --
but that's my problem. Being a relative newcomer to Cocoa, I can't
figure out any obvious way to work with NSImage data except in a very
high level way (resizing, rotating etc).
If you want to get the bitmap data, you can get that into an
NSBitmapImageRep using the -initWithFocusedViewRect: method (with the
current focus either on a view as the name suggest, or on an NSImage for
off-screen use).