• 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
Image data from pasteboard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Image data from pasteboard?


  • Subject: Image data from pasteboard?
  • From: Graham Cox <email@hidden>
  • Date: Mon, 22 Feb 2016 11:47:17 +1100

Hi all,

I can use +[NSImage canInitWithPasteboard:], and then +[NSImage imageWithPasteboard:] to make an NSImage object.

But I’d like to get the actual original image data from the pasteboard, knowing that the data is good to make an NSImage. The reason is so that when pasting an image, I preserve its original data format where possible. Once it’s turned into an NSImage object, my options are limited - if it’s a PDF, I can riffle through the reps and see if there’s a NSPDFImageRep, or I can ask for the image in TIFF or other formats, but that potentially represents a conversion loss from the original data. NSImage doesn’t retain its original data, so information is lost. To avoid that, I’d like to be able to get the data myself and save it in my model, making the NSImage only for local display. If the model is saved, the original data is saved.

So is there a way, given that if +canInitWithPasteboard: returns YES, to get the (NS)data off the pasteboard in whatever format it’s in, knowing that it’s good for making an image?

—Graham



_______________________________________________

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


  • Follow-Ups:
    • Re: Image data from pasteboard?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: How to bind OS-X UI to display the App Bundle "CFShortVersionString" value?
  • Next by Date: UI to allow user to scale and crop image within a circle
  • Previous by thread: Re: How to bind OS-X UI to display the App Bundle "CFShortVersionString" value?
  • Next by thread: Re: Image data from pasteboard?
  • Index(es):
    • Date
    • Thread