mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 20:09:37 +02:00
LCL-CustomDrawn-X11: Fixes the screenshot code
git-svn-id: trunk@36559 -
This commit is contained in:
parent
1bcb7d9585
commit
f1243984e6
@ -312,8 +312,12 @@ begin
|
||||
Result := TQtDesignWidget(WindowHandle).DesignContext = DC;
|
||||
end;*)
|
||||
|
||||
function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer
|
||||
): Boolean;
|
||||
function TCDWidgetSet.IsScreenDC(ADC: HDC): Boolean;
|
||||
begin
|
||||
Result := (ADC = HDC(Self.ScreenDC));
|
||||
end;
|
||||
|
||||
function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean;
|
||||
begin
|
||||
Result := IsValidDC(DC);
|
||||
{ if Result then
|
||||
@ -430,14 +434,21 @@ end;
|
||||
Params: ADC:
|
||||
ADesc:
|
||||
Returns:
|
||||
|
||||
Describes the standard format utilized by Qt
|
||||
------------------------------------------------------------------------------}
|
||||
function TCDWidgetSet.RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescription): Boolean;
|
||||
var
|
||||
lSize: TPoint;
|
||||
begin
|
||||
Result := true;
|
||||
|
||||
ADesc.Init_BPP32_A8R8G8B8_BIO_TTB(100, 100);
|
||||
if ADC = 0 then
|
||||
begin
|
||||
GetDeviceSize(ADC, lSize);
|
||||
ADesc.Init_BPP32_A8R8G8B8_BIO_TTB(lSize.X, lSize.Y);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
ADesc := TLazIntfImage(TLazCanvas(ADC).Image).DataDescription;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -232,22 +232,6 @@ begin
|
||||
ARawImage.Mask:=nil;
|
||||
ARawImage.Palette:=nil;
|
||||
Result := True;
|
||||
|
||||
(* ARawImage.Init;
|
||||
ARawImage.Description.Init_BPP32_A8R8G8B8_BIO_TTB(ScreenBitmapWidth, ScreenBitmapHeight);
|
||||
|
||||
// Take the screenshot
|
||||
screenshotImage := CGDisplayCreateImage(CGMainDisplayID()); // Requires 10.6+
|
||||
|
||||
// Draw it to our screen bitmap
|
||||
lRect := CGRectMake(0, 0, ScreenBitmapWidth, ScreenBitmapHeight);
|
||||
CGContextDrawImage(ScreenBitmapContext, lRect, screenshotImage);
|
||||
|
||||
// Now copy the data
|
||||
ScreenImage.GetRawImage(lScreenRawImage, False);
|
||||
ARawImage.CreateData(False);
|
||||
lDataLength := Min(lScreenRawImage.DataSize, ARawImage.DataSize);
|
||||
System.Move(lScreenRawImage.Data^, ARawImage.Data^, lDataLength); *)
|
||||
end;
|
||||
|
||||
procedure TCDWidgetset.ShowVirtualKeyboard();
|
||||
|
@ -56,6 +56,7 @@ procedure HideVirtualKeyboard();
|
||||
(*
|
||||
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
||||
function IsMobilePlatform: Boolean; override;
|
||||
function IsScreenDC(ADC: HDC): Boolean;
|
||||
|
||||
function PromptUser(const DialogCaption : string;
|
||||
const DialogMessage : string;
|
||||
|
@ -2904,7 +2904,7 @@ begin
|
||||
Result:= False;
|
||||
|
||||
// Screen size
|
||||
if DC = 0 then
|
||||
if IsScreenDC(DC) or (DC = 0) then
|
||||
begin
|
||||
P.X:= GetSystemMetrics(SM_CXSCREEN);
|
||||
P.Y:= GetSystemMetrics(SM_CYSCREEN);
|
||||
|
Loading…
Reference in New Issue
Block a user