Page 1 of 1

CopyToClipboard() seems not to work for MetaFiles

Posted: Fri Mar 10, 2006 4:42 pm
by 9637279
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

Posted: Mon Mar 13, 2006 12:08 pm
by narcis
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.

Posted: Wed Mar 15, 2006 10:25 am
by narcis
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

See also microsoft info about this issue:

Posted: Mon May 22, 2006 5:43 pm
by 9637279
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.

Posted: Tue May 23, 2006 10:19 am
by narcis
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.