It is possible - when you start the drag/drop operation (DoDragDrop
), you pass in a IDataObject - this is the key to allowing what you want.
The easy way to do this is to use a normal DataObject with DataFormats.FileDrop
, and give it the name of the file. Unfortunately this is not quite what you want, but the quick and dirty way for you to do this would be to create a temporary file and pass that as the name. Done.
The hard way is to implement IDataObject and serve up a virtual (in-memory) file containing the image you want. There is an article on codeplex about transferring virtual files to windows explorer via drag-drop that should get you started. Also see http://stackoverflow.com/questions/1187444/drag-and-drop-virtual-files-using-istream