This method retrieves the height and width of the text from the text information. This method is recommended when using scripting or other languages that require variant types.

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetTextExtentVariant(hDC As LONG_PTR, Width As Variant, Height As Variant, UnitMode As DeviceUnitModeConstants)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetTextExtentVariant(hDC As Integer(x86) or Long(x64), ByRef Width As Object, ByRef Height As Object, UnitMode As ImageKit10(A)Lib.DeviceUnitModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.GetTextExtentVariant(int(x86) or long(x64) hDC, ref object Width, ref object Height, ImageKit10(A)Lib.DeviceUnitModeConstants UnitMode)

* ImageKit10ALib refers to the ANSI version, ImageKit10Lib refers to the Unicode version, (x86) refers to the 32 bit version, and (x64) refers to the 64 bit version.

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)

The following constants can be used: (ikPrinterPixel = 0, ikPrinterMM = 1).

 

Return Value

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

Explanation

The GetTextExtentVariant method retrieves the height and width of the text from the text information (single line only).

This method is recommended when using scripting or other languages that require variant types or when using 64 bit builds in VB.NET or C#.

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.

Also see the GetTextExtent 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.

Differences between the ImageKit7/8

The hDC argument type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation