将图表渲染到图像以进行打印? [英] Rendering charts to images for print?
问题描述
我在将图表对象渲染到图像时遇到了一些问题,最终目的是嵌入PDF进行打印。我想通过将控件保存到EMF来实现这一点,但是将图表渲染到EMF似乎有问题,特别是在渲染具有曲线的
a图表时。在条形图等简单图表中,有一些细小的细节会被破坏,例如网格线的粗细,但是使用样条图会变得完全无法识别。如果我尝试渲染到具有高DPI的PNG,
图表上的任何线条都会变得如此之小它们几乎是不可见的。
I'm having some trouble rendering Chart objects to images for the ultimate purpose of embedding in a PDF for print. I'd like to do this by saving the control to EMF, but there seems to be something wrong with rendering charts to EMF, especially when rendering a chart that has curved lines.In simpler charts such as bar graphs, there are some small details that get corrupted such as the thickness of the grid lines, but with a spline graph it becomes totally unrecognizable.If I try rendering to a PNG with a high DPI, any lines on the chart get so small that they are almost invisible.
有没有人成功地将这些图表渲染成高质量的图像?
Has anybody had any success rendering these charts to high quality images?
推荐答案
Hi D Varden,
Hi D Varden,
您可以使用以下方法
format = ChartImageFormat.Bmp OR Jpeg OR Emf OR Gif OR Png OR Tiff
format = ChartImageFormat.Bmp OR Jpeg OR Emf OR Gif OR Png OR Tiff
Chart1.SaveImage(saveFileDialog1.FileName,format)
Chart1.SaveImage(saveFileDialog1.FileName, format)
这篇关于将图表渲染到图像以进行打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!