Как получить разрешение принтера по умолчанию?

Previous  Top  Next

    
 

 

 

Code:

uses

Printers;

 

function GetPixelsPerInchX: Integer;

begin

Result := GetDeviceCaps(Printer.Handle, LOGPIXELSX)

end;

 

function GetPixelsPerInchY: Integer;

begin

Result := GetDeviceCaps(Printer.Handle, LOGPIXELSY)

end;

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

Caption := Format('x: %d y: %d DPI (dots per inch)',

                  [GetPixelsPerInchX, GetPixelsPerInchY]);

end;

 

©Drkb::03201

Взято с сайта http://www.swissdelphicenter.ch/en/tipsindex.php