0 out of 1 rated this helpful - Rate this topic

LPtoDP function

Applies to: desktop apps only

The LPtoDP function converts logical coordinates into device coordinates. The conversion depends on the mapping mode of the device context, the settings of the origins and extents for the window and viewport, and the world transformation.

Syntax

BOOL LPtoDP(
  __in     HDC hdc,
  __inout  LPPOINT lpPoints,
  __in     int nCount
);

Parameters

hdc [in]

A handle to the device context.

lpPoints [in, out]

A pointer to an array of POINT structures. The x-coordinates and y-coordinates contained in each of the POINT structures will be transformed.

nCount [in]

The number of points in the array.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The LPtoDP function fails if the logical coordinates exceed 32 bits, or if the converted device coordinates exceed 27 bits. In the case of such an overflow, the results for all the points are undefined.

LPtoDP calculates complex floating-point arithmetic, and it has a caching system for efficiency. Therefore, the conversion result of an initial call to LPtoDP might not exactly match the conversion result of a later call to LPtoDP. We recommend not to write code that relies on the exact match of the conversion results from multiple calls to LPtoDP even if the parameters that are passed to each call are identical.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Coordinate Spaces and Transformations Overview
Coordinate Space and Transformation Functions
DPtoLP
POINT

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ