[device dots per inch] for monitor

Please discuss general Delphi programming topics here.

[device dots per inch] for monitor

Postby N.Y.P.D. » June 2nd, 2006, 6:32 am

Ladis and Genttlemen, how to get [device dots per inch] for device, which is called monitor. (I am stupid, I need example).
N.Y.P.D.
N.Y.P.D.
Active Member
Active Member
 
Posts: 13
Joined: May 15th, 2006, 1:14 pm
Location: Russia Tver

Postby Kambiz » June 2nd, 2006, 1:36 pm

The following function returns horizontal and vertical DPI of the screen as a point.

Code: Select all
function GetScreenDPI: TPoint;
var
  DC: HDC;
begin
  DC := GetDC(0);
  try
    Result.X := GetDeviceCaps(DC, LOGPIXELSX);
    Result.Y := GetDeviceCaps(DC, LOGPIXELSY);
  finally
    ReleaseDC(0, DC);
  end;
end;


By the way, needing an example has nothing to do with stupidity. All of us get things better when there is an example. ;)
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron