This documentation is archived and is not being maintained.


Converts logical units into device units.

void LPtoDP(
   LPPOINT lpPoints,
   int nCount = 1 
) const;
void LPtoDP(
   LPRECT lpRect 
) const;
void LPtoDP(
   LPSIZE lpSize 
) const;



Points to an array of points. Each point in the array is a POINT structure or a CPoint object.


The number of points in the array.


Points to a RECT structure or a CRect object. This parameter is used for the common case of mapping a rectangle from logical to device units.


Points to a SIZE structure or a CSize object.

The function maps the coordinates of each point, or dimensions of a size, from GDI's logical coordinate system into a device coordinate system. The conversion depends on the current mapping mode and the settings of the origins and extents of the device's window and viewport.

The x- and y-coordinates of points are 2-byte signed integers in the range –32,768 through 32,767. In cases where the mapping mode would result in values larger than these limits, the system sets the values to –32,768 and 32,767, respectively.