Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AtlPixelToHiMetric

 

Converts an object's size in pixels on the screen device to a size in HIMETRIC units (each unit is 0.01 millimeter).

System_CAPS_importantImportant

This function cannot be used in applications that execute in the Windows Runtime.


      extern void AtlPixelToHiMetric(
const SIZEL* lpSizeInPix,
LPSIZEL lpSizeInHiMetric 
);

lpSizeInPix

[in] Pointer to the object's size in pixels.

lpSizeInHiMetric

[out] Pointer to where the object's size in HIMETRIC units is to be returned.

Example

// Initialize our control's default size to 100 by 25 pixels
CMyControl::CMyControl()
{
    // width = 100 pixels, height = 25 pixels
    SIZE sz = { 100, 25 };
    // convert pixels to himetric
    AtlPixelToHiMetric(&sz, &m_sizeExtent);
    // store natural extent
    m_sizeNatural = m_sizeExtent;
}

Requirements

Header: atlwin.h

Show: