Hi,
I tried to save my chart as EMF-File with
this.ultraChart1.SaveTo(sEMFFile, System.Drawing.Imaging.ImageFormat.Emf);
but it fails. It works with png, bmp and other formats, but not with emf or wmf. What am I doing wrong?
Thanks in advance.
Thanks a lot. This sounds not very good.
An alternative for me would be: When there are annotations on a chart and the user should be able to move the annotations accourding his needs, I set the annotations as "dragable" (I saw this in the sample-project).
My question now is: For initial positions of the annotation, can I use the Ultrachart intelligence accourding collision detection and avoidance or do I have to position the annotation by my self?
Hi Grpesc,
There are few available options to save the image from our UltraChart into vector based graphics (for example *.emf or *.wmf).
If you choose the option by using clipboard, you could use the code below:
System.Windows.Forms.Clipboard.Clear(); ultraChart1.CopyToClipboard(); System.Windows.Forms.Clipboard.GetImage().Save("..\\..\\Test_1.emf", System.Drawing.Imaging.ImageFormat.Emf); or System.Windows.Forms.Clipboard.GetImage().Save("..\\..\\Test_1.wmf", System.Drawing.Imaging.ImageFormat.Wmf);
System.Windows.Forms.Clipboard.Clear();
ultraChart1.CopyToClipboard();
System.Windows.Forms.Clipboard.GetImage().Save("..\\..\\Test_1.emf", System.Drawing.Imaging.ImageFormat.Emf);
or
System.Windows.Forms.Clipboard.GetImage().Save("..\\..\\Test_1.wmf", System.Drawing.Imaging.ImageFormat.Wmf);
But as far as I know you will met some issue via this approach because the GDI+ component of the .NET Framework does not have an encoder that allows you to save files as WMF, EMF and the resulting file is saved as a Portable Network Graphics (PNG) file instead, nevertheless that file extension is WMF or EMF. More details about this you could find at http://support.microsoft.com/kb/316563
Other possible approach is to use the code below:
Image im; im = ultraChart1.Image; im.Save("..\\..\\Test_1.emf", System.Drawing.Imaging.ImageFormat.Emf); or im.Save("..\\..\\Test_1.wmf", System.Drawing.Imaging.ImageFormat.wmf);
Image im;
im = ultraChart1.Image;
im.Save("..\\..\\Test_1.emf", System.Drawing.Imaging.ImageFormat.Emf);
im.Save("..\\..\\Test_1.wmf", System.Drawing.Imaging.ImageFormat.wmf);
Please if you have any questions, do not hesitate to ask me
Regards
Hi Georgi,
sorry for the big delay, but I wasn't sure whether this issue comes up accourding our project aquisition or not, but now I know it will.
Let me back up and explain what I want to do. I am working on a presentation tool which display several charts. The user sould be able to export a chart to an external presentation software, mainly Powerpoint. He should be able to adjust the chart in Powerpoint, e.g., moving or deleting the legend, move some annotations etc. I know that this is possible with vector based graphic types (like emf), but not with raster based graphic types (like bmp). Now I am wondering about whether it is possible to export a winchart (via clipboard or file) as vector based graphic.
Could you help me? Thanks in advance.
Hi again,
I am still following your issue. Have you been able to resolve it. Please keep me in touch
Georgi
Hello again,
Yes, it is completely possible to cope the image from the ultraChart and then to save this image in a file using the System.Windows. Please use the code below:
System.Windows.Forms. Clipboard.Clear(); ultraChart1.CopyToClipboard(); System.Windows.Forms. Clipboard.GetImage().Save("D:\\Test_1.emf",System.Drawing.Imaging.ImageFormat.Emf);
System.Windows.Forms.
Clipboard.Clear();
Clipboard.GetImage().Save("D:\\Test_1.emf",System.Drawing.Imaging.ImageFormat.Emf);
Could you please tell me what is the reasons to think that the files from my first example are not in the emf format ? Please try the third suggestion (via CopyToClipboard) and please send me feedback.