mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 04:19:20 +02:00
Qt: added BLACKNESS and WHITENESS support into TQtWidgetSet.StretchMaskBlt()
git-svn-id: trunk@35473 -
This commit is contained in:
parent
5866b2577e
commit
5e51d368a3
@ -6227,6 +6227,7 @@ var
|
|||||||
SrcMatrix: QTransformH;
|
SrcMatrix: QTransformH;
|
||||||
dx, dy: integer;
|
dx, dy: integer;
|
||||||
OldRop: Integer;
|
OldRop: Integer;
|
||||||
|
OldBkColor: TColorRef;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI StretchMaskBlt]',
|
WriteLn('[WinAPI StretchMaskBlt]',
|
||||||
@ -6333,14 +6334,32 @@ begin
|
|||||||
QImage_destroy(TmpMask);
|
QImage_destroy(TmpMask);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
OldRop := DstQDC.Rop2;
|
if (Rop = BLACKNESS) or (Rop = WHITENESS) then
|
||||||
if Rop <> SRCCOPY then
|
begin
|
||||||
DstQDC.Rop2 := Integer(Rop);
|
OldRop := DstQDC.Rop2;
|
||||||
try
|
DstQDC.Rop2 := SRCCOPY;
|
||||||
DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect);
|
try
|
||||||
finally
|
if (Rop = BLACKNESS) then
|
||||||
if Rop <> SRCCOPY then
|
OldBkColor := DstQDC.SetBkColor(clBlack)
|
||||||
|
else
|
||||||
|
OldBkColor := DstQDC.SetBkColor(clWhite);
|
||||||
|
with DstRect do
|
||||||
|
DstQDC.fillRect(Left, Top, Right - Left, Bottom - Top);
|
||||||
|
finally
|
||||||
|
DstQDC.SetBkColor(OldBkColor);
|
||||||
DstQDC.Rop2 := OldRop;
|
DstQDC.Rop2 := OldRop;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
OldRop := DstQDC.Rop2;
|
||||||
|
if Rop <> SRCCOPY then
|
||||||
|
DstQDC.Rop2 := Integer(Rop);
|
||||||
|
try
|
||||||
|
DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect);
|
||||||
|
finally
|
||||||
|
if Rop <> SRCCOPY then
|
||||||
|
DstQDC.Rop2 := OldRop;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user