• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getting path info from PDF image?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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).


References: 
 >Re: getting path info from PDF image? (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Transparent application icon
  • Next by Date: Re: What happens to the AppKit Framework when an user logout ?
  • Previous by thread: Re: getting path info from PDF image?
  • Next by thread: java
  • Index(es):
    • Date
    • Thread