We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can I copy and paste images from MS Office applications onto the Diagram?

Platform: WinForms |
Control: Diagram |
Published Date: April 30, 2011 |
Last Revised Date: February 16, 2018

 

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#]

 

[VB] 

Sample:

Sample

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
JunJoy
Feb 15, 2018

Hello

I use the code in vs2012 but it didn't work. When I copy symbol from visio2016, and here "IntPtr ptr = GetClipboardData(CF_ENHMETAFILE);" always return 0. Another article https://www.syncfusion.com/forums/71540/how-to-import-visio-stencils-to-symbol-palettes says visio version affect the convert code, does it affect copy too? I'm dying for help, thank you. 

Reply
JunJoy
Feb 15, 2018

Hello

I try some new code from https://stackoverflow.com/questions/18602171/copy-enhanced-metafile-from-clipboard-and-save-it-as-an-image/29923975#29923975 and it seems work well. Maybe here is the reson if (OpenClipboard(IntPtr.Zero))

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon