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 807

Summary: Brush not respected when drawing texts directly in GDI canvas
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: CanvasAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: major CC: johnnious
Priority: Normal    
Version: 140220   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=3&t=14988&p=66497#p66497
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2014-06-20 06:09:14 EDT
See the simple example below.
As it is, the text that should be drawn with transparent brush, is drawn with white brush.
If you comment the series FillSampleValues, then the text with the transparent brush is drawn as it should, but the text with the red brush is also drawn in transparent!
This worked fine until v2014.10.140220

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Caption:=TeeMsg_Version;

  Chart1:=TChart.Create(Self);

  with Chart1 do
  begin
    Parent:=Panel2;
    Align:=alClient;
    Canvas:=TTeeCanvas3D.Create;
    View3D:=false;

    Color:=clSilver;

    AddSeries(TLineSeries);
    Series[0].FillSampleValues; //comment this

    OnAfterDraw:=ChartAfterDraw;
  end;
end;

procedure TForm1.ChartAfterDraw(Sender: TObject);
begin
  with Chart1.Canvas do
  begin
    Font.Size:=15;
    Brush.Color:=clRed;
    Brush.Style := bsSolid;
    TextOut(100, 100, 'The brush of this text should be red');

    Brush.Style := bsClear;
    TextOut(100, 150, 'The brush of this text should be transparent');
  end;
end;
Comment 1 John Ioannides 2014-09-19 05:24:51 EDT
Hello,

I need to release new versions for my software but I am stuck with this issue. Since I am a source code customer is there a quick fix I can apply to solve this?
Comment 2 John Ioannides 2014-10-14 05:32:33 EDT
Please give me something, my hands are tight and I cannot release any software update due to this issue.
Comment 3 yeray alonso 2014-11-03 06:07:00 EST
This is solved setting the BackMode to be cbmTransparent after setting the Brush.Style to bsClear:

Brush.Style:=bsClear;
BackMode:=cbmTransparent;

We'll check if making this internally doesn't break anything.