mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 23:39:28 +02:00
win32: erase paint buffer on creation
git-svn-id: trunk@30264 -
This commit is contained in:
parent
f724c04b0b
commit
9f4bb027ae
@ -168,6 +168,7 @@ var
|
||||
Details: TThemedElementDetails;
|
||||
ShowAccel: Boolean;
|
||||
Color: TColor;
|
||||
PaintParams: TBP_PaintParams;
|
||||
begin
|
||||
glyphWidth := srcWidth;
|
||||
glyphHeight := srcHeight;
|
||||
@ -179,7 +180,12 @@ var
|
||||
|
||||
OldBitmapHandle := SelectObject(hdcNewBitmap, NewBitmap);
|
||||
if UseThemes and AlphaDraw then
|
||||
PaintBuffer := BeginBufferedPaint(hdcNewBitmap, @BitmapRect, BPBF_COMPOSITED, nil, TmpDC)
|
||||
begin
|
||||
FillChar(PaintParams, SizeOf(PaintParams), 0);
|
||||
PaintParams.cbSize := SizeOf(PaintParams);
|
||||
PaintParams.dwFlags := BPPF_ERASE;
|
||||
PaintBuffer := BeginBufferedPaint(hdcNewBitmap, @BitmapRect, BPBF_COMPOSITED, @PaintParams, TmpDC);
|
||||
end
|
||||
else
|
||||
begin
|
||||
TmpDC := hdcNewBitmap;
|
||||
@ -191,9 +197,7 @@ var
|
||||
// clear background:
|
||||
// for alpha bitmap clear it with $00000000 else make it solid color for
|
||||
// further masking
|
||||
if PaintBuffer <> 0 then
|
||||
BufferedPaintClear(PaintBuffer, nil)
|
||||
else
|
||||
if PaintBuffer = 0 then
|
||||
begin
|
||||
Windows.FillRect(TmpDC, BitmapRect, GetSysColorBrush(COLOR_BTNFACE));
|
||||
Color := BitBtn.Font.Color;
|
||||
|
Loading…
Reference in New Issue
Block a user