If the color of the panel is clWhite, this code doesn't work:
ABitmap := Chart.TeeCreateBitmap;
The series is not visible.
This a workaround:
ABitmap := Chart.TeeCreateBitmap(TColor($FEFEFE), Chart.GetRectangle);
This seems to work since TColor($FEFEFE) <> the color of the panel.
How can this be fixed?
TeeChart v2011.03.30407
Delphi XE
Jørgen
TeeCreateBitmap doesn't work if panel color is clWhite
Re: TeeCreateBitmap doesn't work if panel color is clWhite
Hello Jørgen,
I can't see any strange behaviour with the following code in v2011.03, am I missing something?
I see the same behaviour with clWhite and clRed.
I can't see any strange behaviour with the following code in v2011.03, am I missing something?
I see the same behaviour with clWhite and clRed.
Code: Select all
uses Chart, ExtCtrls;
var Chart1: TChart;
Image1: TImage;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(self);
Chart1.Parent:=Form1;
Chart1.Color:=clWhite; //clRed;
Image1:=TImage.Create(self);
Image1.Parent:=Form1;
Image1.BoundsRect:=Chart1.BoundsRect;
Image1.Top:=Chart1.Height;
end;
procedure TForm1.Button1Click(Sender: TObject);
var ABitmap: TBitmap;
begin
ABitmap:=Chart1.TeeCreateBitmap;
Image1.Picture.Bitmap:=ABitmap;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeCreateBitmap doesn't work if panel color is clWhite
Added a sample that doesn't work
It is something wrong with load from stream
(It works the second time you click)
Jørgen
It is something wrong with load from stream
(It works the second time you click)
Jørgen
- Attachments
-
- Project2.zip
- (84.96 KiB) Downloaded 520 times
Re: TeeCreateBitmap doesn't work if panel color is clWhite
Hello Jørgen,
Try forcing a Chart repaint after changing the color:
Try forcing a Chart repaint after changing the color:
Code: Select all
Chart1.Color := clRed; //works
Chart1.Draw;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TeeCreateBitmap doesn't work if panel color is clWhite
It worked.
What is the reason?
Is it a bug?
Jørgen
What is the reason?
Is it a bug?
Jørgen
Re: TeeCreateBitmap doesn't work if panel color is clWhite
Hi Jørgen,
This is because TeeCreateBitmap function uses the internal Bitmap already created instead of creating a new one when UseBuffer=true (as per default). So another alternative would be setting it to false:
This is because TeeCreateBitmap function uses the internal Bitmap already created instead of creating a new one when UseBuffer=true (as per default). So another alternative would be setting it to false:
Code: Select all
Chart1.Canvas.UseBuffer:=false;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |