Export to image. Resolution of image too low.
Export to image. Resolution of image too low.
Dear Sir/Madam,
When exporting the TChart to JPEG (Quality = 100), TIF, WMF, ... we noticed that the image resolution was not high enough.
Our code :
Steema.TeeChart.Export.JPEGFormat jPEG;
jPEG = tChart2.Export.Image.JPEG;
jPEG.Height = tChart1.Height;
jPEG.Width = tChart1.Width;
jPEG.Quality =100;
jPEG.Save(outputPath);
or
tChart1.Export.Image.Metafile.bEnhanced = true;
tChart1.Metafile.Save(outputPath,System.Drawing.Imaging.ImageFormat.Emf);
Is there a way to increase the resolution of the exported image ?
Thanks & Kind regards,
Erwin
When exporting the TChart to JPEG (Quality = 100), TIF, WMF, ... we noticed that the image resolution was not high enough.
Our code :
Steema.TeeChart.Export.JPEGFormat jPEG;
jPEG = tChart2.Export.Image.JPEG;
jPEG.Height = tChart1.Height;
jPEG.Width = tChart1.Width;
jPEG.Quality =100;
jPEG.Save(outputPath);
or
tChart1.Export.Image.Metafile.bEnhanced = true;
tChart1.Metafile.Save(outputPath,System.Drawing.Imaging.ImageFormat.Emf);
Is there a way to increase the resolution of the exported image ?
Thanks & Kind regards,
Erwin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Erwin,
You could try setting the Quality property, at TChart's editor 3D tab, to "Best Quality" or "Antialias".
You can also set it using:
You could try setting the Quality property, at TChart's editor 3D tab, to "Best Quality" or "Antialias".
You can also set it using:
Code: Select all
tChart1.Graphics3D.SmoothingMode= System.Drawing.Drawing2D.SmoothingMode.HighQuality;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi,
I have tested the settings you suggested but there was no improvement found on resolution of the exported image.
The problem is not the quality of the chart. It's the quality of the exported image who's resolution is too low.
I did following tests :
* I exported the image to JPEG and EMF file, opened it in Microsoft Office Picture Manager and printed (on paper) the image. => RESULT : Quality = POOR.
* I printed (on paper) the image from within my application using : Chart1.Printer.Preview(); => RESULT : Quality = GOOD.
Because of the fact that the imagefile will be picked up by an other process (documentgenerator) that uses the image and fits it into a document, we need to export the chart to an image first.
Is there a way to increase the resolution of the image file?
Kind regards,
Erwin
[/list]
I have tested the settings you suggested but there was no improvement found on resolution of the exported image.
The problem is not the quality of the chart. It's the quality of the exported image who's resolution is too low.
I did following tests :
* I exported the image to JPEG and EMF file, opened it in Microsoft Office Picture Manager and printed (on paper) the image. => RESULT : Quality = POOR.
* I printed (on paper) the image from within my application using : Chart1.Printer.Preview(); => RESULT : Quality = GOOD.
Because of the fact that the imagefile will be picked up by an other process (documentgenerator) that uses the image and fits it into a document, we need to export the chart to an image first.
Is there a way to increase the resolution of the image file?
Kind regards,
Erwin
[/list]
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Erwin,
To get the same results as you, could you please let us know which TeeChart version are you using?
Thanks in advance.
To get the same results as you, could you please let us know which TeeChart version are you using?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Erwin,
We have tested again here using latest Debug Build version available at our Customer Download Area and there is almost no noticeable difference between the WinForm, the JPEG and the EMF file. Can you please download this version and test if it works at your end?
BTW: The code I used to create the images was:
We have tested again here using latest Debug Build version available at our Customer Download Area and there is almost no noticeable difference between the WinForm, the JPEG and the EMF file. Can you please download this version and test if it works at your end?
BTW: The code I used to create the images was:
Code: Select all
private void button2_Click(object sender, System.EventArgs e)
{
Steema.TeeChart.Export.JPEGFormat jpeg = tChart1.Export.Image.JPEG;
jpeg.Quality = 100;
jpeg.Save(@"C:\temp\chart.jpeg");
}
private void button3_Click(object sender, System.EventArgs e)
{
System.Drawing.Imaging.Metafile m = tChart1.Metafile;
m.Save(@"C:\temp\chart.emf", System.Drawing.Imaging.ImageFormat.Emf);
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
I downloaded the latest debug build version (2.0.2105.30289) and tested the export to image function again. This had no possitive result.
I also installed the latest release version, but again it had no effect.
The quality is still poor. You can see this when you look at the labels. Compare the labels at the X and Y axe from a printout (on paper !) made with the Teechart.Printer.preview function and the printout (on paper !) of the JPEG file. You should see definitely the difference in quality between the 2 printouts.
I even tried the "Demoproject", that comes with the installation of TeeChart, and compared the printouts of our JPEG file with the one we made with the demoproject : They both have the same problem with the quality of the labels.
Is there a way to send you some of samples of our JPEG-files ? So you could see it yourself?
Kind regards,
Erwin
I downloaded the latest debug build version (2.0.2105.30289) and tested the export to image function again. This had no possitive result.
I also installed the latest release version, but again it had no effect.
The quality is still poor. You can see this when you look at the labels. Compare the labels at the X and Y axe from a printout (on paper !) made with the Teechart.Printer.preview function and the printout (on paper !) of the JPEG file. You should see definitely the difference in quality between the 2 printouts.
I even tried the "Demoproject", that comes with the installation of TeeChart, and compared the printouts of our JPEG file with the one we made with the demoproject : They both have the same problem with the quality of the labels.
Is there a way to send you some of samples of our JPEG-files ? So you could see it yourself?
Kind regards,
Erwin
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Erwin,
TeeChart uses code virtually identical to the following:
http://tinyurl.com/cuz3e
or
http://groups.google.es/group/microsoft ... ges.csharp
/browse_frm/thread/e6f5f06cc3eb3c25/0ace6f1bef1e9269?lnk=st&q
=creating+jpeg+files+in+c%23+group%3Amicrosoft.public.dotnet.*
&rnum=2&hl=en#0ace6f1bef1e9269
to create its JPEG files with the Quality property being the equivalent of the getQuality() method. The bitmap we pass to our version of this method is the one that can be accessed from the Steema.TeeChart.TChart.Bitmap property and is created thus:
This methodology is completely standard to the .NET Framework, as you can see, and as yet we have been able to find an alternative way to create JPEG files. You may like to experiment yourself with JPEG file creation using the Bitmap available from the Steema.TeeChart.TChart.Bitmap property to see if you can find a better way to create a JPEG. If you do, please don't hesitate to let us know
TeeChart uses code virtually identical to the following:
http://tinyurl.com/cuz3e
or
http://groups.google.es/group/microsoft ... ges.csharp
/browse_frm/thread/e6f5f06cc3eb3c25/0ace6f1bef1e9269?lnk=st&q
=creating+jpeg+files+in+c%23+group%3Amicrosoft.public.dotnet.*
&rnum=2&hl=en#0ace6f1bef1e9269
to create its JPEG files with the Quality property being the equivalent of the getQuality() method. The bitmap we pass to our version of this method is the one that can be accessed from the Steema.TeeChart.TChart.Bitmap property and is created thus:
Code: Select all
Bitmap b = new Bitmap(width, height, pixelformat); //width and height of chart
Draw(Graphics.FromImage(b)); //internal teechart draw method
return b;
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi,
Printing uses the Graphics of the System.Drawing.Printing.PrintPageEventArgs thus:
where Steema.TeeChart.TChart.Metafile is basically created thus:
Again, all very standard .NET procedure for drawing to a printer canvas and for Metafile creation.
PDF exportation is a different issue as the PDF has its own proprietory "canvas language" which PDF readers can render. TChart has its own Steema.TeeChart.Drawing.Graphics3DPDF class to interpret its .NET native canvas primitives to PDF's "canvas language".
Printing uses the Graphics of the System.Drawing.Printing.PrintPageEventArgs thus:
Code: Select all
e.Graphics.DrawImage(m /*metafile from Steema.TeeChart.TChart.Metafile*/,r /*rectangle to draw to*/ ,chart.chartBounds,GraphicsUnit.Pixel);
Code: Select all
Bitmap bitmap = new Bitmap(1, 1, PixelFormat.Format24bppRgb);
Graphics gRef = Graphics.FromImage(bitmap);
IntPtr hDC = gRef.GetHdc();
Metafile mf = new System.Drawing.Imaging.Metafile(new MemoryStream(), hDC);
gRef.ReleaseHdc(hDC);
gRef.Dispose();
gRef = Graphics.FromImage(mf);
aChart.Draw(gRef, new Rectangle(0, 0, width, height)); //internal Draw method
PDF exportation is a different issue as the PDF has its own proprietory "canvas language" which PDF readers can render. TChart has its own Steema.TeeChart.Drawing.Graphics3DPDF class to interpret its .NET native canvas primitives to PDF's "canvas language".
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/