Unit 'LCLIntf' Package
[Overview][Types][Procedures and functions][Variables][Index] [#lcl]

GetDeviceCaps

Returns various device specific information.

Declaration

Source position: winapih.inc line 124

function GetDeviceCaps(

  DC: HDC;

  Index: Integer

):Integer;

Description

Returns information about any DC (Device Context), which might be the screen DC representing the monitor, a control canvas or a off-screen bitmap canvas. The following constants can be utilized in the index argument:

An example showing how to obtain the screen DPI for the X axis using GetDeviceCaps, which is the method utilized by TScreen.PixelsPerInch:

var
  DC: HDC;
begin
  DC := GetDC(0);
  FDPI := GetDeviceCaps(DC,LOGPIXELSX); // DPI in pixels per inch
  ReleaseDC(0, DC);
end;

See also

TScreen.PixelsPerInch

  

The number of screen pixels per virtual inch (DPI) for the screen.

HORZSIZE

  

VERTSIZE

  

HORZRES

  

BITSPIXEL

  

PLANES

  

SIZEPALETTE

  

LOGPIXELSX

  

LOGPIXELSY

  

VERTRES

  

NUMRESERVED

  



CT Web help

CodeTyphon Studio