Watch, Follow, &
Connect with Us
Public Report
Report From: EDN/Discussion Forums    [ Add a report in this area ]  
Report #:  134425   Status: Reported
transparent labels, DoubleBuffered bug
Project:  EDN Build #:  Delphi XE7 Vers
Version:    2 Submitted By:   Marcel Rasche
Report Type:  Issue Date Reported:  10/20/2015 2:32:50 AM
Severity:    Serious / Highly visible problem Last Updated:
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Create own labels, with base class TCustomControl
Set this labels to transparent.

If is the doubleBuffered is activated then the last contents of bufferns will be paint also.
Set by the TForm the DoubleBuffered:= true.

If the doubleBuffered  is deactivated, then the painting of the items are correct.

If compile the same src with delphi 2007 all works fine.

In the appendix are to screenshots

transparent_with_doubleBuffer.png : Bug,  paint with wrong doublebuffer content (the last label).
transparent_without_doubleBuffer.png : paint without doublebuffer, all correct.
transparent_with_doubleBuffer2.png : Bug, Bug,  paint with wrong doublebuffer content ( the last picture)
transparent_without_doubleBuffer2.png: paint without doublebuffer, all correct.


Steps to Reproduce:
create a TForm and set doubleBuffered:= true.
Create a own panel with base class  TCustomControl and set doubleBuffered:= true.
create more then one own labels with base class TCustomControl put the labels in the panel and set also doubleBuffered:= true.

TLBPanel = class(TCustomControl)
TLBLabel = class(TCustomControl)

set to transparent with (by the panel and the label)

ControlStyle := ControlStyle - [csOpaque];
Brush.Style := bsClear;
setwindowlong(handle, GWL_EXSTYLE,AStyle or WS_EX_TRANSPARENT);

procedure TLBPanel.Paint();
...
  inherited;
  Canvas.Brush.Style:=bsClear;
  Canvas.FillRect(R);



procedure TLBLabel.Paint();
..
Canvas.Brush.Style:=bsClear;
Canvas.FillRect(R);
...
TextOut(x,y,_StrCaption);
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01