Steema Issues Database

Note: 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.



Bug 613 - TBitmap is being painted non-transparent if GDI+ canvas is used. The same code works OK if GDI+ Active is set to false.
Summary: TBitmap is being painted non-transparent if GDI+ canvas is used. The same cod...
Status: RESOLVED INVALID
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 140220
Hardware: PC Windows
: Normal minor
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-28 16:09 EST by Vsevolod V Gromov
Modified: 2015-01-12 05:20 EST (History)
2 users (show)

See Also:
Chart Series: Line
Delphi / C++ Builder RAD IDE Version: RAD XE4


Attachments
Test C++ Builder project for case study (13.19 KB, application/octet-stream)
2014-03-03 14:01 EST, Vsevolod V Gromov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod V Gromov 2014-02-28 16:09:24 EST

    
Comment 1 sandra pazos 2014-03-03 06:01:30 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,
Comment 2 Vsevolod V Gromov 2014-03-03 14:01:01 EST
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.
Comment 3 david berneda 2014-03-06 07:51:17 EST
Attachment can't be compiled, its missing a library (cportlib_ecc18.lib)