ILogCoordinatesImpl::LPtoCP

Convert logical units to container units

Defined in: LogCoordinatesImpl.h

Syntax

LPtoCP( LPPOINT lpPoints, int nCount)

LPtoCP( LPRECT lpRect )

LPtoCP( LPSIZE lpSize )

Return Value

void

Parameters

lpPoints

A pointer to an array of points to convert.

lpRect

A logical rectangle to convert

lpSize

A logical size to convert

Comments

Use this function to convert an array of points, a rectangle, or a size from logical units to container units. There is one very important subtlety that you should be aware of. The following two calls may yield entirely different results:

LPtoCP(CPoint(5, 5)) LPtoCP(CSize(5, 5))

The first call determines which point in the parents coordinate space the logical unit 5, 5 is located at. The second call determines the number of container units in 5 logical units along the X axis and 5 units along the Y axis. In other words, the first call takes the logical origin into account. The second does not, as size is independent of the origin.

nCount

The number of points in the array