installing v8 over v4

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 01, 2009 8:51 am

Hi Roy,
1] Does this seem reasonable?
Yes, it is likely that C++ Builder 4 is not able to resolve folders with blank spaces on it.
2] If so, should it also work with v8?
I have tried it here but it seems Chart1->Title is still throwing an Access Violation. We will investigate the issue further.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

installing v8 over v4

Post by Roy » Wed Apr 01, 2009 1:50 pm

Narcis:
Thanks for your help. Will use v6 for now since it works and has the changes for logarithmic axis that we were looking for. What about v7?
Does it work with BCB4? Does it have save to JPG image routines?
Roy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Apr 01, 2009 2:37 pm

Hi Roy,
What about v7? Does it work with BCB4?
I'm afraid not. Has same problem as v8.
Does it have save to JPG image routines?


Yes, as v6 does as you can see in the All Features\Welcome!\Exporting\Chart Picture\JPEG example in the new features demo available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

installing v8 over v4

Post by Roy » Wed Apr 01, 2009 4:01 pm

Narcis:
Again thanks for the response. What function in v6 is used to save the graph to JPG format? The only function I find is the SaveToBitmapFile() function.
Roy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 02, 2009 7:10 am

Hi Roy,

Have you looked at the demo I told you? It is available with the features demo shipped with the binary installers. You'll also find a full JPEG example at Tutorial 12 - Exporting and Importing Charts. Tutorials are also available at TeeChart's progrma group created by the binary installers. Here's tutorial info:

JPEG
JPEG file export has additional parameters for speed and quality. See the JPEG demo included in the Examples folder. The Export method has not been included natively for TeeChart to avoid the memory overhead for non-JPEG applications.

Example

Code: Select all

// You need to include the Delphi JPEG unit in the Uses section of your project
// Pass the name of the Chart to this function. We've fixed the parameters here.
// In the demo they are presented as options for the user.
// Place a Chart (Chart1) on a Form and populate it with data.

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 With GetChartJPEG(Chart1) do
 try
  SaveToFile('c:\temp\myJPEGChart.jpg');    { <-- save the JPEG to disk }
 finally
  Free;  { <-- free the temporary JPEG object }
 end;
end;

Function GetChartJPEG(AChart:TCustomChart):TJPEGImage;
var tmpBitmap:TBitmap;
begin
  result:=TJPEGImage.Create;   { <-- create a TJPEGImage }
  tmpBitmap:=TBitmap.Create;   { <-- create a temporary TBitmap }
  try
    tmpBitmap.Width :=AChart.Width;   { <-- set the bitmap dimensions }
    tmpBitmap.Height:=AChart.Height;
    { draw the Chart on the temporary Bitmap... }
    AChart.Draw(tmpBitmap.Canvas,Rect(0,0,tmpBitmap.Width,tmpBitmap.Height));
    { set the desired JPEG options... }
    With result do
    begin
      GrayScale            :=False;
      ProgressiveEncoding  :=True;
      CompressionQuality   :=50;  // % 0 - 100
      PixelFormat          :=jf24bit;  // or jf8bit
      ProgressiveDisplay   :=True;
      Performance          :=jpBestQuality;  // or jpBestSpeed
      Scale                :=jsFullSize;  // or jsHalf, jsQuarter, jsEighth
      Smoothing            :=True;
      { Copy the temporary Bitmap onto the JPEG image... }
      Assign(tmpBitmap);
    end;
  finally
    tmpBitmap.Free;  { <-- free the temporary Bitmap }
  end;
end;
Performance, jpegBestQuality, and the Compression Quality percentage (high value less compression), will make the file larger and thus slower to transmit across a network - quality is better though! You will need to decide on the best balance to suit your application.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

installing v8 over v4

Post by Roy » Thu Apr 02, 2009 11:24 am

Narcis:
I found the function TeeSaveToJPEGFile() which needs the header file TeeJPEG.hpp which I included. The program compiled but would not link because it could resolve the TeeSaveToJPEGFile() call. Do you know what library file or unit I need to use in my program. Unfortunately the code you show is in Pascal and I am using BCB4 which is C++.
Roy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 02, 2009 11:50 am

Hi Roy,

It's in TeeJPEG unit. Have you added a pragma link to this unit in your unit?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

installing v8 over v4

Post by Roy » Thu Apr 02, 2009 12:06 pm

Narcis:
I have founf the TeeJPEG.hpp file but not the TeeJPEG unit. Also how would use the Pragma for this?
Roy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 02, 2009 1:17 pm

Hi Roy,

No, adding TeeJPEG.hpp to the unit's .h should be enough. Which is the exact error message you get?

BTW: You may also need to include JPEG unit as described here.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roy
Newbie
Newbie
Posts: 64
Joined: Wed Feb 25, 2009 12:00 am
Location: Dallas, Texas
Contact:

installing v8 over v4

Post by Roy » Thu Apr 02, 2009 1:39 pm

Narcis:
Thanks for the reply. I cannot fint the TeeJPEG unit and have included the TeeJPEG.hpp header file. I get the following error:
[Linker Error]Unresolved external '__teejpeg::TeeSaveToJPEGFile(....)'

This would indicate I need either the TeeJPEG.cpp file (unit) or the library file with the code.
Roy

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Apr 06, 2009 2:00 pm

Hi Roy,

It works fine for me here using v6.01 installer for BCB 4 and copying its "CBuilder4" folder to a path with no blank spaces on it (eg.: C:\temp\CBuilder4). then I set "Bin" and "Lib" folders there at the search path lists.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply