縮放與版面配置
當Project Options 勾選 Enable High-DPI ,專案的界面會依照縮放比例做調整,Screen.PixelsPerInch會取得與縮放比對應的數值 (Ex: 縮放比125%會取得120)
沒有勾選 Enable High-DPI,Screen.PixelsPerInch會取得 96 (縮放比100%)
Var
iHorzres, iDesktopHorzres:Integer;
iScale:Currency;
begin
iHorzres := GetDeviceCaps(GetDC(0), HORZRES); //水平像素總數
iDesktopHorzres := GetDeviceCaps(GetDC(0), DESKTOPHORZRES); // 桌面水平像素總數
iScale := iDesktopHorzres / iHorzres ;
end
影響QuickRep 報表版面配置的處理方式
with QuickRep1 do
begin
...
...
ScaleBy(Screen.PixelsPerInch * iScale , Screen.PixelsPerInch);
Prepare;
...
...
end;