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

[C++Builder]   [ TSize = ]imagekitcontrolname->PrintDraw->GetTextExtent(HDC DC, TVIkDeviceUnitMode UnitMode)
[Delphi]   [ TSize = ]imagekitcontrolname.PrintDraw.GetTextExtent(DC: HDC; UnitMode: TVIkDeviceUnitMode)

[TVIkDeviceUnitMode Type]

Unit
     ImageKit

type
     TVIkDeviceUnitMode = (vikPrinterPixel, vikPrinterMM);

Parameters

Name Explanation
DC The device context
UnitMode The units of measure of the retrieved values (vikPrinterPixel: pixels, vikPrinterMM: 0.1mm)

Return Value

Returns the height and width of the string. Returns 0 if unsuccessful.
The width is set in TSize.cx. The height is set in TSize.cy.

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.

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

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

Differences between the ImageKit7/8/9/10

In VCL the constants contain a "v". In ActiveX, the constants are: ikPrinterPixel, ikPrinterMM.
The Width and Height parameters have been deleted. The return value has changed.

 

The ImageKit10 VCL is a product created by Newtone Corporation