This function draws text in the designated object. The text is drawn from a specified point in the designated object.(screen, printer, image data).

[C++Builder]     BOOL IKTextOut(LPVOID DeviceValue, int x, int y, PTR_IKPRINT_TEXTINFO TextInfo, LPCSTR Text, BYTE DeviceMode);
[Delphi]         function IKTextOut(DeviceValue: THandle; x, y: Integer; var TextInfo: IKPRINT_TEXTINFO; Text: PChar; DeviceMode: Byte): LongBool;

Parameters

Name Explanation
DeviceValue The device context or the raster image data (depending on the DeviceMode)
x,y The x and y coordinates of the starting point of the text
TextInfo Structure whose members set the drawing information
Text The text that is drawn (the terminus is NULL)
DeviceMode The designated object where the text is drawn (0: Screen, 1: Printer, 2: Image data)

Return Value

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

Explanation

The IKTextOut function draws text in the designated object from a point specified by the x and y parameters (screen, printer, image data). It is recommended that you set the following member variables of the TextInfo structure prior to executing this function: CharSet, TextColor1, TextColor2, FontName, FontSize, Transparent, Direction, CharAngle, and RotateString. If 1 or more is set into the CharExtra member variable then the character spacing is enabled.

When the RotateString member variable is False, the CharAngle member variable is enabled for 0, 90, 180, and 270 degrees only. Any other settings for the CharAngle member variable will result in the IKTextOut function failing. When the RotateString member variable is True, the Direction member variable is disabled and the text is drawn from the x and y coordinates in the direction set in the CharAngle member variable. Note: Even if Text contains code to force a line break, this function will not output it correct. You can either seperate multiline text into single lines and execute this function multiple times or use the IKDrawText function.

If the DeviceMode parameter is 0 or 2 then x, y parameters, and the CharExtra member variable are in pixel units.

If the DeviceMode parameter is 1 then x, y parameters, and the CharExtra member variable are in 0.1mm units.

The differences from the ImageKit5

Function Name parameters
IK5TextOut(A): DeviceValue, x, y, PrintInfo
IKTextOut: DeviceValue, x, y, TextInfo, Text, DeviceMode

PrintInfo and TextInfo structures are different, however the member variables in PrintInfo are used in the same way in TextInfo.

IK5PRINT_DATA --> IKPRINT_TEXTINFO
CharExtra, CharSet, RotateString, Alpha1,Alpha2, and HotkeyPrefix have been added and Text has been deleted.
TextForeColor and TextBackColor have been renamed to TextColor1 and TextColor2.

By setting PrintInfo.Text to the Text parameter; setting the value used in IK5SetDeviceMode to the DeviceMode parameter; setting the TextInfo's CharSet to -1, CharExtra to 0, HotkeyPrefix to 1; and setting TextForeColor and TextBackColor to TextColor1 and TextColor2 respectively; this function will operate the same as in the ImageKit5.

The differences from the ImageKit6

Alpha1, Alpha2, and HotkeyPrefix have been added to the IKPRINT_TEXTINFO structure, and the TextForeColor and TextBackColor have beed renamed to the TextColor1 and TextColor2. If the HotkeyPrefix is set to 1, and the TextForeColor and TextBackColor are set to TextColor1 and TextColor2, then this function is the same as in ImageKit6.

 

The ImageKit9 VCL is a product created by Newtone Corporation