Resolution and other features in the FourChart example

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sde
Newbie
Newbie
Posts: 21
Joined: Fri Jun 21, 2013 12:00 am

Resolution and other features in the FourChart example

Post by sde » 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

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Resolution and other features in the FourChart example

Post by Yeray » Wed Mar 16, 2016 1:08 pm

Hello,
sde wrote:1) How might I do this to export to a PDF? I found this old post from 2005 (viewtopic.php?f=3&t=2835&p=9987&hilit=exporting+four+charts+to+pdf&sid=c663294656b4787b8164741fe324ae90#p9987) where you stated it would be added to the wish list. Has this by chance been added in the last 10 years?
I'm afraid I can't find this old feature request so I've added a new one:
http://bugs.teechart.net/show_bug.cgi?id=1473

Feel free to add your mail to the CC list to be automatically notified when an update arrives.
sde wrote: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:
I'll take a look at each feature an I'll tell you something asap.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Resolution and other features in the FourChart example

Post by Yeray » Thu Mar 17, 2016 4:01 pm

Hello,
Yeray wrote:
sde wrote: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:
I'll take a look at each feature an I'll tell you something asap.
Regarding the printing resolution. Take a look at the printing better article here.

Regarding the options in the editor, if you have the TeeChart sources you can take a look yourself at the units.
An alternative would be to navigate through the online reference.
I'll try to brief:
  • BMP Options (TeeBmpOptions.pas):
    • Colors. This is used to set the PixelFormat property in TBitmap class. PixelFormat is of the type TPixelFormat, defined at Graphics.pas.
    • Monochrome is a property in TBitmap class.
    • DPI. This is set as explained here.
  • JPEG Options (TeeJPEG.pas):
    • Quality: This changes the CompressionQuality in TJPEGDefaults, defined in jpeg.pas. CompressionQuality is of the type TJPEGQualityRange also defined at jpeg.pas.
    • Gray Scale: This changes the Grayscale property (boolean) in jpeg.pas.
    • Compression Quality: CompressionQuality is a property of the type TJPEGQualityRange and it's defined in jpeg.pas.
    • DPI: Pending. I'll edit this asap.
  • PNG Options (TeePNG.pas):
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply