![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | TBitmap is being painted non-transparent if GDI+ canvas is used. The same code works OK if GDI+ Active is set to false. | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | Vsevolod V Gromov <gromov.vsevolod> |
| Component: | Canvas | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED INVALID | ||
| Severity: | minor | CC: | david, sandra |
| Priority: | Normal | ||
| Version: | 140220 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | Line | Delphi / C++ Builder RAD IDE Version: | RAD XE4 |
| Attachments: | Test C++ Builder project for case study | ||
|
Description
Vsevolod V Gromov
2014-02-28 16:09:24 EST
Hello Vsevolod,
Unfortunately, we can’t reproduce your problem using the below code:
Chart1: TChart;
CheckBox1: TCheckBox;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Chart1BeforeDrawChart(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses VCLTee.Series, VCLTee.TeeStore, VCLTee.TeeBmpOptions, VCLTee.TeCanvas;
var Series1:TLineSeries;
Bitmap,Bitmap1: TBitmap;
procedure TForm1.Button1Click(Sender: TObject);
begin
if CheckBox1.Checked then
begin
Bitmap1:=Chart1.TeeCreateBitmap;
Bitmap1.SaveToFile('E:\transparencyChartGDIplus.bmp');
end
Else
begin
Bitmap1:=Chart1.TeeCreateBitmap;
Bitmap1.SaveToFile('E:\transparencyChartGDI.bmp');
end;
end;
procedure TForm1.Chart1BeforeDrawChart(Sender: TObject);
begin
if not Assigned(Bitmap) then
begin
Bitmap:=TBitmap.Create;
Bitmap.Width:=Chart1.Width;
Bitmap.Height:=Chart1.Height;
Bitmap.Canvas.CopyRect(Chart1.ClientRect,Canvas,Chart1.BoundsRect);
end;
if Chart1.Color=clNone then
Chart1.Canvas.Draw(0,0,Bitmap);
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
Chart1.Canvas:=TGDIPlusCanvas.Create
else
Chart1.Canvas:=TTeeCanvas3D.Create;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.Gradient.Visible:=False;
Chart1.Color := clNone;
Form1.Color := clRed;
Series1:=TLineSeries.Create(Self);
Chart1.Walls.Back.Transparent:=True;
Chart1.AddSeries(Series1);
Series1.FillSampleValues();
CheckBox1.Checked := True;
end
Could you confirm if previous code works in your end? If so, could you please give us a more complete code example with which we can reproduce the problem here?
Thanks in advance,
Created attachment 109 [details]
Test C++ Builder project for case study
The 'horse foot' colour area on CIE xyz diagram is dynamically generated TBitmap, which uses black as transparency key colour.
I tried Alpha channel in GDI+ with similar result. The colour 0xff000000 was used for transparent areas.
Attachment can't be compiled, its missing a library (cportlib_ecc18.lib) |