It would be great if the chart component would have an export to xaml.
Failure.
The resulting emf file is Yes an enhanced metafile but it only contains the image in bitmap form. so resizeing in another applicaition (Word, Excel) produces an unacceptable image.
Metafiles should contain Text, Lines (Vectors), and Images.
The code example about only produces the images portion. :-(
Thanks for your help.
pat
I will test it first thing in the morning.
If this works you saved my butt!
Thanks
you're right, it does save as a PNG. I didn't realize that earlier, but it turns out that is documented here: http://msdn.microsoft.com/en-us/library/system.drawing.imaging.metafile.aspx
I was able to create what I think is a true EMF using this test code:
UltraChart ch = new UltraChart();
ch.Data.DataSource = Infragistics.UltraChart.Data.DemoTable.Table();
ch.Data.DataBind();
Graphics gfx = Graphics.FromImage(ch.Image);
Metafile emf = new Metafile(@"C:\test.emf", gfx.GetHdc());
Graphics emfGraphics = Graphics.FromImage(emf);
emfGraphics.DrawImage(ch.Image, new Point(0, 0));
emfGraphics.Dispose();
gfx.Dispose();
will that work for you?
Ok, i tried the svg with the following code:
Dim fs As System.IO.FileStream = New System.IO.FileStream("C:\Users\pat.knoll\Documents\Man32\t.svg", IO.FileMode.Create) Me.UltraChart1.SaveTo(fs, Infragistics.UltraChart.Shared.Styles.RenderingType.Svg)
So Yes i get an SVG file. i can tell this by opening the file in notepad and observing the xml.
My goal is to export my chart image to Word or Excel so it does not get distorted.
Word does not support the svg format (could have guesed that one. Thanks for nothing Microsoft).
Anyway,l HELP
Exporting bitmaps just does not cut it. we need a method to export that will maintain the charts visual quality.
OK, i upgraded to winchart v11.1 and the following still throws an error.
Case "WMF" Me.UltraChart1.SaveTo(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Wmf)
Case "EMF" Me.UltraChart1.SaveTo(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Emf)
ALSO
Both lines below still create a png file. you can see this by opening the resulting emf and wmf files in notpad and look at the first line.
Dim im As Image im = UltraChart1.Image im.Save(Props.AppDataFolderPath & "Test_1.emf", System.Drawing.Imaging.ImageFormat.Emf) im.Save(Props.AppDataFolderPath & "Test_1.wmf", System.Drawing.Imaging.ImageFormat.Wmf)
I am using .NET 2.0. Is this the issue?
Do you have any proof of concept code that demonstrates this feature working correctly?
thanks