SaveToBitmapFile and SaveToJPEGFile

TeeChart for ActiveX, COM and ASP
Post Reply
nbp
Newbie
Newbie
Posts: 24
Joined: Tue Apr 28, 2015 12:00 am

SaveToBitmapFile and SaveToJPEGFile

Post by nbp » Wed Jun 24, 2015 10:04 pm

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?

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

Re: SaveToBitmapFile and SaveToJPEGFile

Post by Yeray » Thu Jun 25, 2015 10:13 am

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.
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

nbp
Newbie
Newbie
Posts: 24
Joined: Tue Apr 28, 2015 12:00 am

Re: SaveToBitmapFile and SaveToJPEGFile

Post by nbp » Fri Jun 26, 2015 3:22 pm

Thanks. What are the units for the Width and Height parameters?

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

Re: SaveToBitmapFile and SaveToJPEGFile

Post by Yeray » Mon Jun 29, 2015 8:18 am

Hi,
nbp wrote:What are the units for the Width and Height parameters?
Pixels.
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