CopyToClipboard() seems not to work for MetaFiles

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
fano
Newbie
Newbie
Posts: 56
Joined: Wed Jun 22, 2005 4:00 am
Location: USA, California

CopyToClipboard() seems not to work for MetaFiles

Post by fano » Fri Mar 10, 2006 4:42 pm

Hi,
I use code like this to copy a tChart onto the clipboard as a metafile:

Steema.TeeChart.Export.MetafileFormat METAGpic;
METAGpic = tChart1.Export.Image.Metafile;
METAGpic.EMFFormat = System.Drawing.Imaging.EmfType.EmfOnly;
METAGpic.CopyToClipboard();

When I try Ctrl-V onto a World document nothing is there.
It works for the other picture formats without a problem.

Why would the metafile not work? Is there a workaround?

Thanks,
fano

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 13, 2006 12:08 pm

Hi fano,

Thanks for reporting. I've been able to reproduce the problem here and added it (TF02011312) to our defect list to be fixed for future releases. There's no workaround I can think of for now.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Mar 15, 2006 10:25 am

Hi fano,

After further investigation we found that metafiles cannot be copied to clipboard without going unmanged. As TeeChart.dll is 100% managed code, metafiles cannot and will not be copied to clipboard.

For further information please read:

http://groups.google.com/group/microsof ... a74be9ff4b

or

http://tinyurl.com/lk8gn
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

fano
Newbie
Newbie
Posts: 56
Joined: Wed Jun 22, 2005 4:00 am
Location: USA, California

See also microsoft info about this issue:

Post by fano » Mon May 22, 2006 5:43 pm

I found this info and thought I hand it on. There is a suggested workaround in that article:


http://support.microsoft.com/default.as ... -us;323530

PRB: Metafiles on Clipboard Are Not Visible to All Applications

CAUSE
This problem occurs because 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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 23, 2006 10:19 am

Hi fano,

Thanks for the information. We are aware of such workarounds, but, as I commented before, this is not feasible with TeeChart as it is fully written in managed code and this workaround would require going unmanaged.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply