Page 1 of 1

SaveToBitmapFile and SaveToJPEGFile

Posted: Wed Jun 24, 2015 10:04 pm
by 16673658
I recently upgraded from TChart ActiveX v7 to v2015. The APIs for SaveToBitmapFile and SaveToJPEG file have changed. What default arguments do I use in my code for the new parameters? The first argument is the file name in both cases but I need to get some idea of what defaults to use for the other arguments in the calls?

In SaveToBitmapFile, I've used 0 for the DPI but with SaveToJPEGFile, there are many more arguments. Are there any examples I can refer to?

Re: SaveToBitmapFile and SaveToJPEGFile

Posted: Thu Jun 25, 2015 10:13 am
by yeray
Hello,

As you've seen SaveToBitmapFile and SaveToJPEGFile have added a [DPI As Long] parameter. Note this parameter is optional and the rest of parameters in SaveToJPEGFile were already in v7.

In v7 we had:
- Options for BMP:

Code: Select all

TChart1.Export.SaveToBitmapFile(FileName As String)
TChart1.Export.asBMP.SaveToFile(FileName As String)
- Options for JPEG:

Code: Select all

TChart1.Export.SaveToJPEGFile(FileName As String, Gray As Boolean, Performance As EJPEGPerformance, Quality As Long, Width As Long, Height As Long)
TChart1.Export.asJPEG.SaveToFile(FileName As String)
In v2015 these methods are:
- Options for BMP:

Code: Select all

TChart1.Export.SaveToBitmapFile(FileName As String, [DPI As Long])
TChart1.Export.asBMP.SaveToFile(FileName As String)
- Options for JPEG:

Code: Select all

TChart1.Export.SaveToJPEGFile(FileName As String, Gray As Boolean, Performance As EJPEGPerformance, Quality As Long, Width As Long, Height As Long, [DPI As Long])
TChart1.Export.asJPEG.SaveToFile(FileName As String)
The arguments in SaveToJPEGFile are:
- FileName As String: Complete path and filename to create the image file.
- Gray As Boolean: Choose if the generated image should be colored or B&W.
- Performance As EJPEGPerformance: jpegBestQuality or jpegBestSpeed.
- Quality As Long: 100 = best quality, 25 = pretty awful.
- Width As Long, Height As Long: Define the image size.
- [DPI As Long]: Define the DPIs of the image. Optional.

Re: SaveToBitmapFile and SaveToJPEGFile

Posted: Fri Jun 26, 2015 3:22 pm
by 16673658
Thanks. What are the units for the Width and Height parameters?

Re: SaveToBitmapFile and SaveToJPEGFile

Posted: Mon Jun 29, 2015 8:18 am
by yeray
Hi,
nbp wrote:What are the units for the Width and Height parameters?
Pixels.