• 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
initWithPasteboard: which representation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

initWithPasteboard: which representation


  • Subject: initWithPasteboard: which representation
  • From: Robert Clair <email@hidden>
  • Date: Mon, 20 Sep 2004 09:33:18 -0400


I'm working on my cut and paste - in particular pasting stuff in
from Adobe Illustrator. I check to see if I can init an image from the pasteboard:


[NSImage canInitWithPasteboard: pboard];

and then do

NSImage* newImage =
           [[[NSImage alloc] initWithPasteboard: pboard] autorelease];

The question is - is the way initWithPasteboard: chooses a representation when
there is more than one dtat type available documented anywhere ?


I put in some code to log the available types and then looked with gdb to see which
type representation I got. I was surprised to find that I got a NSPICTImageRep even
when a dump of the types array showed that PDF data was available. I thought
PICT use was being discouraged.


One other issue/problem: The NSPICTImageRep works just fine - it redraws at screen
resolution when I zoom so that things always look smooth. But if I force the paste to use
PDF by allocating a NSPDFImageRep


NSPDFImageRep* pdfImageRep = [NSPDFImageRep imageRepWithData:
                   [pboard dataForType: NSPDFPboardType]];

and adding it to an empty NSImage, the result is ugly. It is already pixelated at the initial
resolution and gets worse if you zoom. (Yes, I've set:


      [newImage setScalesWhenResized: YES];
      [newImage setDataRetained: YES];  )

Has anyone else had this problem ? (It may be a problem with AI, perhaps they've sent
a low relatively low res image wrapped in a pdf - their spool pdf's are images wrapped
in a pdf.)


Thanks,

Bob Clair


_______________________________________________ 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
  • Prev by Date: Re: NSTableView subclass with column-spanning text?
  • Next by Date: Select a NSBezierPath
  • Previous by thread: Resampling/resizing pictures (solved but why ?)
  • Next by thread: Select a NSBezierPath
  • Index(es):
    • Date
    • Thread