Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Copy paste to other applications (Read 1536 times)
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Copy paste to other applications
Nov 16th, 2010 at 6:47am
Print Post  
Hi there!

Does anybody knows how to copy/paste the diagram as an emf file. I managed to save the diagram as an emf file but the same code does not work for the copy/paste.

Microsoft Office Word does not paste any data when the diagram is copied as emf to the clipboard.

Also the DIB format!

Regards,
Octavian
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Copy paste to other applications
Reply #1 - Nov 16th, 2010 at 7:52am
Print Post  
Hi,

According to this KB article, "the .NET Framework uses a new Clipboard format when it adds metafiles to the Clipboard. Other applications, such as Microsoft Word, or the operating system are not aware of this new format and, therefore, cannot paste or display the image". Using the ClipboardMetafileHelper from it, copying to the clipboard and pasting into Word worked fine in my test:

Code
Select All
WmfExporter wmfExporter = new WmfExporter();
wmfExporter.Export(diagram, "temp.wmf");
Metafile metafile = new Metafile("temp.wmf");
ClipboardMetafileHelper.PutEnhMetafileOnClipboard(this.Handle, metafile); 



Here you can find some sample code for converting a System.Drawing.Bitmap to a DIB:
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/bc35d445-10a1-473c...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint