Hi,
I have read some conflicting posts on the status of exporting transparant series in TeeChart.
In my experience, only bmp export works OK now. As this is not a very useful format, I was hoping that png would work as well, and some messages in your forum state that it works for png exports (in 8.03 to be specific). In my experience, it does however NOT work in 8.06 and 8.07
I worked around the problem by exporting to bmp and then using the built in png support in Delphi 2009 to convert to png, but this should not be necessary.
Any ideas ?
Regards, Matt
Support for transparent series in exports
Re: Support for transparent series in exports
Hi Matt,
This can be done in a similar way than the descibed here. For PNG:
This can be done in a similar way than the descibed here. For PNG:
Code: Select all
uses Series, TeePNG, TeeBMPOptions;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 2 do
with Chart1.AddSeries(TAreaSeries.Create(self)) as TAreaSeries do
begin
FillSampleValues();
MultiArea:=maStacked;
Transparency:=50;
AreaLinesPen.Visible:=false;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
tmpPNG: TPNGExportFormat;
MetaCanvas: TMetafileCanvas;
Bitmap: TBMPExportFormat;
begin
tmpPNG := TPNGExportFormat.Create;
tmpPNG.Panel:=Chart1;
try
Bitmap:= TBMPExportFormat.Create;
Bitmap.Panel:=Chart1;
try
tmpPNG.Height := Bitmap.Height;
tmpPNG.Width := Bitmap.Width;
tmpPNG.Bitmap.Canvas.Draw(0,0,Bitmap.Bitmap(TBMPOptions.Create(self)));
tmpPNG.SaveToFile('C:\tmp\test.png');
finally
Bitmap.Free;
end;
finally
tmpPNG.Free;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Support for transparent series in exports
Thanks Yeray,
That works fine! (after losing the (TBMPOptions.Create(self)) part, no problem)
This allows me to use older versions of Delphi as well, as I still use Delphi 6 for our main project.
Also saves handling another temporary file.
Regards, Matt
That works fine! (after losing the (TBMPOptions.Create(self)) part, no problem)
This allows me to use older versions of Delphi as well, as I still use Delphi 6 for our main project.
Also saves handling another temporary file.
Regards, Matt
Re: Support for transparent series in exports
Hi Matt,
I'm glad to head that!
I'm glad to head that!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |