Image data from pasteboard?
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