|
Essential Diagram does not have pre-built support for interfacing with clipboard copy/paste from the MS Office applications. The Diagram copy/paste implementation is confined to 'Node' type drawing objects that are native to Essential Diagram. To copy/paste an image, the Clipboard's data object should be an instance of the Diagram.ClipboardNodeCollection type populated with a Diagram.BitmapNode or a Diagram.MetafileNode that wraps the image. Since .NET uses its own format that is not compatible with the EnhancedMetafile format, you will have to use reflection to achieve this feature of copying and pasting images from MS Office applications like Excel, PowerPoint, Word, or Visio. The sample provided in this Knowledge Base article demonstrates how you can add support to your Essential Diagram application to allow copy/paste from MS Office. [C#]
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
//Handle EnhancedMetafile format from the clipboard and insert MetafileNode { MetafileNode mfnode = new MetafileNode(metafile); |