General XMetaL Discussion
pooh2583 January 23, 2013 at 10:04 am
copy paste a clipboard fileJanuary 23, 2013 at 10:04 amParticipants 1Replies 2Last Activity 10 years ago
I am copying a particualr image file on a clipboard, and i want to copy paste that clipbord file into a loacation where my xml file (ActiveDocument ) is present.
How to achieve this copy paste functionality for Xmetal
RegardsDerek Read January 23, 2013 at 6:58 pm
Reply to: copy paste a clipboard fileJanuary 23, 2013 at 6:58 pm
If the path to the image is on the clipboard then you can use Windows File System Object to move or copy that file to the location you need it to be.
You can use the standard Windows ClipBrd.exe tool (aka: ClipBook Viewer) to see what formats are on the clipboard. You can then use XMetaL's clipboard API to get the path from the text on the clipboard (assuming it is there).
If what is on the clipboard is the actual bitmap image data (user pressed “print screen” or perhaps copied something from a graphics application) then you will need to use 3rd party software or write your own (possibly as a DLL) to save what is on the clipboard to a file. The solution will probably very much depend on which software you end up using and your exact needs (probably which image formats you wish to support). I suspect it would be quite tricky to implement this type of thing. If you wish to implement your own solution using a DLL then you could end up creating an event called On_Drop_
where the latter portion is defined by Application.AcceptDropFormat or ActiveDocument.AcceptDropFormat. There is limited documentation for this in the Programmers Guide under the topic “when objects are dropped”. It is limited because we do not have an example of a DLL that can handle a specific clipboard format and no guidance as to how you would write one. You might get started with a search like this: http://www.google.com/search?q=dll+clipboard+format
- You must be logged in to reply to this topic.