mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-30 19:49:30 +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;
|
Result := TQtDesignWidget(WindowHandle).DesignContext = DC;
|
||||||
end;*)
|
end;*)
|
||||||
|
|
||||||
function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer
|
function TCDWidgetSet.IsScreenDC(ADC: HDC): Boolean;
|
||||||
): Boolean;
|
begin
|
||||||
|
Result := (ADC = HDC(Self.ScreenDC));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := IsValidDC(DC);
|
Result := IsValidDC(DC);
|
||||||
{ if Result then
|
{ if Result then
|
||||||
@ -430,14 +434,21 @@ end;
|
|||||||
Params: ADC:
|
Params: ADC:
|
||||||
ADesc:
|
ADesc:
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
Describes the standard format utilized by Qt
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TCDWidgetSet.RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescription): Boolean;
|
function TCDWidgetSet.RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescription): Boolean;
|
||||||
|
var
|
||||||
|
lSize: TPoint;
|
||||||
begin
|
begin
|
||||||
Result := true;
|
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;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -232,22 +232,6 @@ begin
|
|||||||
ARawImage.Mask:=nil;
|
ARawImage.Mask:=nil;
|
||||||
ARawImage.Palette:=nil;
|
ARawImage.Palette:=nil;
|
||||||
Result := True;
|
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;
|
end;
|
||||||
|
|
||||||
procedure TCDWidgetset.ShowVirtualKeyboard();
|
procedure TCDWidgetset.ShowVirtualKeyboard();
|
||||||
|
@ -56,6 +56,7 @@ procedure HideVirtualKeyboard();
|
|||||||
(*
|
(*
|
||||||
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
||||||
function IsMobilePlatform: Boolean; override;
|
function IsMobilePlatform: Boolean; override;
|
||||||
|
function IsScreenDC(ADC: HDC): Boolean;
|
||||||
|
|
||||||
function PromptUser(const DialogCaption : string;
|
function PromptUser(const DialogCaption : string;
|
||||||
const DialogMessage : string;
|
const DialogMessage : string;
|
||||||
|
@ -2904,7 +2904,7 @@ begin
|
|||||||
Result:= False;
|
Result:= False;
|
||||||
|
|
||||||
// Screen size
|
// Screen size
|
||||||
if DC = 0 then
|
if IsScreenDC(DC) or (DC = 0) then
|
||||||
begin
|
begin
|
||||||
P.X:= GetSystemMetrics(SM_CXSCREEN);
|
P.X:= GetSystemMetrics(SM_CXSCREEN);
|
||||||
P.Y:= GetSystemMetrics(SM_CYSCREEN);
|
P.Y:= GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
Loading…
Reference in New Issue
Block a user