![]() | 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: | Brush not respected when drawing texts directly in GDI canvas | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | yeray alonso <yeray> |
| Component: | Canvas | Assignee: | 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: | |
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? Please give me something, my hands are tight and I cannot release any software update due to this issue. 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. |
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;