mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 11:19:10 +02:00
winapi: don't request mask handle if bitmap is not masked when copy it to the clipboard (bug #0013029)
git-svn-id: trunk@18395 -
This commit is contained in:
parent
63f262a089
commit
632fda53b8
@ -636,7 +636,7 @@ function TWin32WidgetSet.ClipboardGetOwnerShip(ClipboardType: TClipboardType;
|
||||
BufferString: ansistring;
|
||||
{$ENDIF}
|
||||
ScreenDC, MemDC: HDC;
|
||||
OldBitmap, NewBitmap: HBitmap;
|
||||
OldBitmap, NewBitmap, Mask: HBitmap;
|
||||
begin
|
||||
DataStream := TMemoryStream.Create;
|
||||
BufferStream := TMemoryStream.Create;
|
||||
@ -654,9 +654,13 @@ function TWin32WidgetSet.ClipboardGetOwnerShip(ClipboardType: TClipboardType;
|
||||
MemDC := Windows.CreateCompatibleDC(ScreenDC);
|
||||
NewBitmap := Windows.CreateCompatibleBitmap(ScreenDC, Bitmap.Width, Bitmap.Height);
|
||||
OldBitmap := Windows.SelectObject(MemDC, NewBitmap);
|
||||
if Bitmap.Masked then
|
||||
Mask := Bitmap.MaskHandle
|
||||
else
|
||||
Mask := 0;
|
||||
StretchMaskBlt(MemDC, 0, 0, Bitmap.Width, Bitmap.Height,
|
||||
Bitmap.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height,
|
||||
Bitmap.MaskHandle, 0, 0, SRCCOPY);
|
||||
Mask, 0, 0, SRCCOPY);
|
||||
Windows.SelectObject(MemDC, OldBitmap);
|
||||
Windows.DeleteDC(MemDC);
|
||||
Windows.SetClipboardData(FormatID, NewBitmap);
|
||||
|
Loading…
Reference in New Issue
Block a user