[Overview][Types][Procedures and functions][Variables][Index] Reference for unit 'LCLIntf' (#lcl)

GetDeviceCaps

Returns various device specific informations.

Declaration

Source position: winapih.inc line 123

function GetDeviceCaps(

  DC: HDC;

  Index: Integer

):Integer;

Description

Returns informations about any DC, which might be the screen DC representing the monitor, a control canvas or a offscreen 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

#lcl.Forms.TScreen.PixelsPerInch

  

The number of screen pixels for an virtual inch (DPI), in vertical direction.

#lcl.LCLType.HORZSIZE

  

Horizontal size in millimeters

#lcl.LCLType.VERTSIZE

  

Vertical size in millimeters.

#lcl.LCLType.HORZRES

  

Horizontal width in pixels

#lcl.LCLType.BITSPIXEL

  

Number of bits per pixel

#lcl.LCLType.PLANES

  

Number of color planes.

#lcl.LCLType.SIZEPALETTE

  

Number of entries in the color palette

#lcl.LCLType.LOGPIXELSX

  

The number of pixels per logical inch, in X (horizontal) direction.

#lcl.LCLType.LOGPIXELSY

  

The number of pixels per logical inch, in Y (vertical) direction.

#lcl.LCLType.VERTRES

  

Vertical height in pixels

#lcl.LCLType.NUMRESERVED

  

Number of reserved entries in the color palette

The latest version of this document can be found at lazarus-ccr.sourceforge.net.