Re: Getting filenames of NSImage(s)
Re: Getting filenames of NSImage(s)
- Subject: Re: Getting filenames of NSImage(s)
- From: John Timmer <email@hidden>
- Date: Mon, 24 Feb 2003 15:11:09 -0500
>
I'm trying to find a good way to capture the filename of an image
>
dropped into an NSImageView box. I've poured through documentation for
>
NSImage and NSImageView trying to find a good way to do this with no
>
success. At first, I thought this would work:
>
I've not implemented drag & drop, but the developer docs say:
When dragging files, the dragging pasteboard can transfer the files in four
different ways. The pasteboard can hold a list of file paths, a single URL,
a file's complete contents, or a promise to create files at a location to be
determined by the destination.
Given that, you can probably not only extract the image data from the
dragged object, but the file path (assuming there is one, ie - the drag
didn't come out of another image view). There seems to be good information
on how to do so here in the developer docs - the path should look like so:
file:///Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/Dra
gandDrop/Tasks/acceptingdrags.html
Cheers,
John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.