mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 04:48:03 +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 GetLeft: Integer;
|
||||
function GetHeight: Integer;
|
||||
function GetPixelsPerInch: Integer;
|
||||
function GetTop: Integer;
|
||||
function GetWidth: Integer;
|
||||
function GetBoundsRect: TRect;
|
||||
@ -955,6 +956,7 @@ type
|
||||
property BoundsRect: TRect read GetBoundsRect;
|
||||
property WorkareaRect: TRect read GetWorkareaRect;
|
||||
property Primary: Boolean read GetPrimary;
|
||||
property PixelsPerInch: Integer read GetPixelsPerInch;
|
||||
end;
|
||||
|
||||
{ TMonitorList }
|
||||
|
@ -27,6 +27,16 @@ begin
|
||||
Result := Left;
|
||||
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;
|
||||
begin
|
||||
with GetBoundsRect do
|
||||
|
Loading…
Reference in New Issue
Block a user