 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ken Davies Guest
|
Posted: Tue May 15, 2007 12:16 am Post subject: Save TeeChart as JPeg in D2007 |
|
|
I'd like to save a chart as a jpeg file. Is there any way of doing this in
D2007? There doesn't seem to a any documentation for teecharts in the help
files.
TIA
Ken Davies |
|
| Back to top |
|
 |
David Berneda Guest
|
Posted: Tue May 15, 2007 2:29 pm Post subject: Re: Save TeeChart as JPeg in D2007 |
|
|
Hi Ken
The code below creates a jpeg and as an example it saves the jpeg to a file
in c:\ folder.
The jpeg "CompressionQuality" parameter is important to balance between jpeg
file size and image quality.
TeeChart help files, tutorials, docs and examples can be found free of
charge inside the
trial versions of TeeChart "Pro", at www.teechart.com
regards
david
www.teechart.com
uses
JPEG;
function ChartToJpeg(Chart:TCustomChart):TJPEGImage;
var tmpBitmap : TBitmap;
begin
result:=TJPEGImage.Create;
{ create a temporary bitmap }
tmpBitmap:=Chart.TeeCreateBitmap;
try
{ set the desired JPEG options... }
With result do
begin
CompressionQuality:=95;
{ Copy the temporary Bitmap onto the JPEG image... }
Assign(tmpBitmap);
end;
finally
tmpBitmap.Free; { <-- free the temporary Bitmap }
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var MyJpeg : TJPEGImage;
begin
MyJpeg:=ChartToJpeg(Chart1);
try
MyJpeg.SaveToFile('c:\test.jpg');
finally
MyJpeg.Free;
end;
end;
"Ken Davies" <krdavies (AT) ivojo (DOT) co.uk> wrote in message
news:4648b5d4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I'd like to save a chart as a jpeg file. Is there any way of doing this in
D2007? There doesn't seem to a any documentation for teecharts in the help
files. |
|
|
| Back to top |
|
 |
Ken Davies Guest
|
Posted: Tue May 15, 2007 2:42 pm Post subject: Re: Save TeeChart as JPeg in D2007 |
|
|
Many thanks for the fast respose. A quick question about the Pro version:
I'm creating a simple line chart with two series. Would the Pro version
allow me to shade the area between the series lines with a colour?
Many thanks,
Ken Davies
"David Berneda" <david (AT) steema (DOT) com> wrote in message
news:46497d7e$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi Ken
The code below creates a jpeg and as an example it saves the jpeg to a
file in c:\ folder.
The jpeg "CompressionQuality" parameter is important to balance between
jpeg file size and image quality.
TeeChart help files, tutorials, docs and examples can be found free of
charge inside the
trial versions of TeeChart "Pro", at www.teechart.com
regards
david
www.teechart.com
uses
JPEG;
function ChartToJpeg(Chart:TCustomChart):TJPEGImage;
var tmpBitmap : TBitmap;
begin
result:=TJPEGImage.Create;
{ create a temporary bitmap }
tmpBitmap:=Chart.TeeCreateBitmap;
try
{ set the desired JPEG options... }
With result do
begin
CompressionQuality:=95;
{ Copy the temporary Bitmap onto the JPEG image... }
Assign(tmpBitmap);
end;
finally
tmpBitmap.Free; { <-- free the temporary Bitmap }
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var MyJpeg : TJPEGImage;
begin
MyJpeg:=ChartToJpeg(Chart1);
try
MyJpeg.SaveToFile('c:\test.jpg');
finally
MyJpeg.Free;
end;
end;
"Ken Davies" <krdavies (AT) ivojo (DOT) co.uk> wrote in message
news:4648b5d4$1 (AT) newsgroups (DOT) borland.com...
I'd like to save a chart as a jpeg file. Is there any way of doing this
in D2007? There doesn't seem to a any documentation for teecharts in the
help files.
|
|
|
| Back to top |
|
 |
Narcís Calvet Guest
|
Posted: Tue May 15, 2007 5:04 pm Post subject: Re: Save TeeChart as JPeg in D2007 |
|
|
Hi Ken,
Ken Davies wrote:
| Quote: | Many thanks for the fast respose. A quick question about the Pro
version: I'm creating a simple line chart with two series. Would the
Pro version allow me to shade the area between the series lines with
a colour?
|
Yes, this is possible using SeriesBand tool included with TeeChart Pro v7
VCL. You can download the fully functional evaluation version here:
http://www.steema.com/downloads/form_tch_vcl.html
--
Best Regards,
Narcis Calvet
Steema Support Central
http://support.steema.com
"Important note: If you are a TeeChart registered customer, please post your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply." |
|
| Back to top |
|
 |
Mat Ballard Guest
|
Posted: Wed May 16, 2007 4:47 am Post subject: Re: Save TeeChart as JPeg in D2007 |
|
|
Ken Davies wrote:
| Quote: | I'd like to save a chart as a jpeg file. Is there any way of doing this
|
Bad idea (TM). Introduces lots of visual artifacts. You don't need the 24-bit
colour either.
Use a GIF instead - TGifImage - 8 bit, non-lossy. Just save your chart as a
bitmap in memory, assign the bitmap to the TGifImage, and save the TGifImage.
Suggest you experiment in your favourite image editor to _see_ why. |
|
| Back to top |
|
 |
Ken Davies Guest
|
Posted: Tue May 22, 2007 8:12 am Post subject: Re: Save TeeChart as JPeg in D2007 |
|
|
Done that, see what you mean.
Cheers
"Mat Ballard" <mat (AT) chemwares (DOT) com> wrote in message
news:464a4675$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Ken Davies wrote:
I'd like to save a chart as a jpeg file. Is there any way of doing this
Bad idea (TM). Introduces lots of visual artifacts. You don't need the
24-bit
colour either.
Use a GIF instead - TGifImage - 8 bit, non-lossy. Just save your chart as
a
bitmap in memory, assign the bitmap to the TGifImage, and save the
TGifImage.
Suggest you experiment in your favourite image editor to _see_ why. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|