dc := GetDC(0);
logicalScreenHeight := GetDeviceCaps(
dc, VERTRES);
physicalScreenHeight := GetDeviceCaps(
dc, DESKTOPVERTRES);
ReleaseDC(0,
dc);
if logicalScreenHeight <> physicalScreenHeight
then
begin
rc.Right := rc.Left + MulDiv(rc.Right - rc.Left, physicalScreenHeight, logicalScreenHeight);
rc.Bottom := rc.Top + MulDiv(rc.Bottom - rc.Top, physicalScreenHeight, logicalScreenHeight);
end;
function scaleToNativeDeskRes(pVal: Integer): Integer;
var tTemp: HDC;
begin
tTemp := GetDC(0);
try
Result := MulDiv(pVal, GetDeviceCaps(tTemp, DESKTOPVERTRES), GetDeviceCaps(tTemp, VERTRES));
finally
ReleaseDC(0, tTemp);
end;
end;
Printer.Canvas.StretchDraw( Rect( 0, 0,
scaleToNativeDeskRes(Printer.PageWidth),
scaleToNativeDeskRes(Printer.PageHeight) ), mf );