mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 17:36:12 +02:00
lcl: add TMonitor.PixelsPerInch
git-svn-id: trunk@53687 -
This commit is contained in:
parent
c52584ecb0
commit
9ec0b84232
@ -940,6 +940,7 @@ type
|
|||||||
function GetInfo(out Info: TMonitorInfo): Boolean; {inline; fpc bug - compilation error with inline}
|
function GetInfo(out Info: TMonitorInfo): Boolean; {inline; fpc bug - compilation error with inline}
|
||||||
function GetLeft: Integer;
|
function GetLeft: Integer;
|
||||||
function GetHeight: Integer;
|
function GetHeight: Integer;
|
||||||
|
function GetPixelsPerInch: Integer;
|
||||||
function GetTop: Integer;
|
function GetTop: Integer;
|
||||||
function GetWidth: Integer;
|
function GetWidth: Integer;
|
||||||
function GetBoundsRect: TRect;
|
function GetBoundsRect: TRect;
|
||||||
@ -955,6 +956,7 @@ type
|
|||||||
property BoundsRect: TRect read GetBoundsRect;
|
property BoundsRect: TRect read GetBoundsRect;
|
||||||
property WorkareaRect: TRect read GetWorkareaRect;
|
property WorkareaRect: TRect read GetWorkareaRect;
|
||||||
property Primary: Boolean read GetPrimary;
|
property Primary: Boolean read GetPrimary;
|
||||||
|
property PixelsPerInch: Integer read GetPixelsPerInch;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TMonitorList }
|
{ TMonitorList }
|
||||||
|
@ -27,6 +27,16 @@ begin
|
|||||||
Result := Left;
|
Result := Left;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMonitor.GetPixelsPerInch: Integer;
|
||||||
|
var
|
||||||
|
X, Y: UINT;
|
||||||
|
begin
|
||||||
|
if WidgetSet.GetDpiForMonitor(FHandle, MDT_EFFECTIVE_DPI, X, Y)=S_OK then
|
||||||
|
Result := X
|
||||||
|
else
|
||||||
|
Result := Screen.PixelsPerInch;
|
||||||
|
end;
|
||||||
|
|
||||||
function TMonitor.GetHeight: Integer;
|
function TMonitor.GetHeight: Integer;
|
||||||
begin
|
begin
|
||||||
with GetBoundsRect do
|
with GetBoundsRect do
|
||||||
|
Loading…
Reference in New Issue
Block a user