Freigeben über


GetInkExtent Method

GetInkExtent Method

Specifies the display properties to set on the text ink object (tInk), and retrieves the width of the text ink object in HIMETRIC units.

Syntax

[C++]

HRESULT GetInkExtent (
    [in] INKMETRIC* pim
    [out] UINT* pnWidth
);

Parameters

pim

[in] A pointer to an INKMETRIC structure, which contains the display properties to set on the text ink object, or NULL (Nothing in Microsoft® Visual Basic® 6.0).

pnWidth

[out] The width of the text ink object in HIMETRIC units.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The pnWidth parameter is NULL.
E_OUTOFMEMORY Could not complete the operation. The display properties are not changed.

Remarks

If the pim parameter is null (Nothing in Visual Basic .NET), then the display properties are not changed and the existing properties are used to calculate the extent of the text ink object; otherwise, the display properties are updated, and the extent is calculated from the new properties.

If the IMF_FONT_SELECTED_IN_HDC flag is set in the pim parameter, then the properties of the device context are applied to the ink; otherwise, the INKMETRIC settings of the text ink object are applied.