Jump to content
Software FX Community

Increasing the resolution of an exported image


User (Legacy)

Recommended Posts

Posted

ChartFX images are currently generated at 96dpi but our printer requires 

that the images be at least 300dpi.

This is how I export the images:

chart.Export(FileFormat.Png, filePath);

Please let me know how I can increase the resolution of the images.

Thanks,

Merill

Posted

The following code exports the chart to a bitmap with 300 DPI:

Rectangle r = new Rectangle(0,0,(chart1.Width * 300) / 96,(chart1.Height *

300) / 96);

Bitmap bmp = new Bitmap(r.Width,r.Height);

bmp.SetResolution(300,300);

Graphics g = Graphics.FromImage(bmp);

chart1.Paint(g,r,PaintStyles.Background | PaintStyles.Border |

PaintStyles.Print);

bmp.Save(@"c:\temp\cfxdpi.bmp");

g.Dispose();

bmp.Dispose();

--

Francisco Padron

www.chartfx.com

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...