This method retrieves the height and width of the text from the text information.

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetTextExtent(hDC As Long, Width As Long, Height As Long, UnitMode As DeviceUnitModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().GetTextExtent(long hDC, long *Width, long *Height, long UnitMode)

Parameters

Name Explanation
hDC The device context
Width Retrieves the width of the text
Height Retrieves the height of the text
UnitMode The units of measure of the retrieved values (0: pixels, 1: 0.1mm)

In Visual Basic the following constants can be used: (ikPrinterPixel = 0, ikPrinterMM = 1).

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The GetTextExtent method retrieves the height and width of the text from the text information (single line only). To execute this method the CharSet, FontName, FontSize, Direction, CharAngle, and RotateString properties should be set. If the CharExtra property value is 1 or more, the values returned in the Width and Height parameters will reflect the additional space between characters. When the RotateString property is False, regardless of the direction of the text or the rotation of the characters, the Width parameter refers to the horizontal size of the text and the Height parameter refers to the vertical size of the text. When the RotateString property is True, the Width parameter refers to the size of the text in the direction that it is drawn and the Height parameter refers to the size of the text in the vertical direction. When the RotateString is False, the CharAngle property is enabled only for values of 0, 90, 180, and 270 degrees.

For scripting languages and other programs that require variant types, please refer to the GetTextExtentVariant method.

If the UnitMode parameter is 0 then the Width and Height parameters will be in pixel units.

If the UnitMode parameter is 1 then the Width and Height parameters will be in 0.1mm units.

 

The ImageKit8 ActiveX is a product created by Newtone Corporation