Resolution and other features in the FourChart example
Posted: Sun Mar 13, 2016 1:05 am
Hi,
The program I support exports a lot of graphics using the method presented in the Four Charts example you include with the program. That is, we create a TBitMap and paint it's canvas using the Chart.Draw function of each chart in question. Then, based on what type the user choses, we assign this TBitMap to either a TJPEGImage, TGIFImage, or TPNGImage and use the SaveToFile procedure. I have two questions for you.
1) How might I do this to export to a PDF? I found this old post from 2005 (http://www.teechart.net/support/viewtop ... ae90#p9987) where you stated it would be added to the wish list. Has this by chance been added in the last 10 years?
2) We've had several complaints from our users regarding the resolution of our charts. So we would like to expand our interface for our "Four Charts" exporting to include all of the same options that you provide on the export tab of the TChartEditor. This would mean having the ability to add the following for each chart type:
Bitmap: Colors, Monochrome, DPI
GIF: Compression, Dither, Reduction
JPEG: Quality, Gray Scale, Compression Quality, DPI
PNG: Compression Level
The things listed in bold are part of the TBitmap, TGIFImage, TJPEGImage, and TPNGImage classes. However, I cannot access the others. And DPI is the one I need the most. Can you please provide some help on how I can set the resolution and the other non-bold properties above? I tried TeeSetBitMapDPI and I'm not sure that really changed the DPI and when I copied the result to a JPEG, those were static at 96 DPI regardless of what resolution the original Bitmap was set to.
I would really appreciate your help!
SDE
The program I support exports a lot of graphics using the method presented in the Four Charts example you include with the program. That is, we create a TBitMap and paint it's canvas using the Chart.Draw function of each chart in question. Then, based on what type the user choses, we assign this TBitMap to either a TJPEGImage, TGIFImage, or TPNGImage and use the SaveToFile procedure. I have two questions for you.
1) How might I do this to export to a PDF? I found this old post from 2005 (http://www.teechart.net/support/viewtop ... ae90#p9987) where you stated it would be added to the wish list. Has this by chance been added in the last 10 years?
2) We've had several complaints from our users regarding the resolution of our charts. So we would like to expand our interface for our "Four Charts" exporting to include all of the same options that you provide on the export tab of the TChartEditor. This would mean having the ability to add the following for each chart type:
Bitmap: Colors, Monochrome, DPI
GIF: Compression, Dither, Reduction
JPEG: Quality, Gray Scale, Compression Quality, DPI
PNG: Compression Level
The things listed in bold are part of the TBitmap, TGIFImage, TJPEGImage, and TPNGImage classes. However, I cannot access the others. And DPI is the one I need the most. Can you please provide some help on how I can set the resolution and the other non-bold properties above? I tried TeeSetBitMapDPI and I'm not sure that really changed the DPI and when I copied the result to a JPEG, those were static at 96 DPI regardless of what resolution the original Bitmap was set to.
I would really appreciate your help!
SDE