This method draws text in a rectangle specified in the designated object (the screen, printer, or image data).

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.DrawText(DeviceValue As LONG_PTR, left As Long, top As Long, right As Long, bottom As Long, EnableFontScale As Boolean, Clip As Boolean, DeviceMode As OutPutDeviceModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().DrawText(LONG_PTR DeviceValue, long left, long top, long right, long bottom, BOOL EnableFontScale, BOOL Clip, long DeviceMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.DrawText(DeviceValue As Integer(x86) or Long(x64), left As Integer, top As Integer, right As Integer, bottom As Integer, EnableFontScale As Boolean, Clip As Boolean, DeviceMode As ImageKit9(A)Lib.OutPutDeviceModeConstants)
[C#.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.DrawText(int(x86) or long(x64) DeviceValue, int left, int top, int right, int bottom, bool EnableFontScale, bool Clip, ImageKit9(A)Lib.OutPutDeviceModeConstants DeviceMode)

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

Parameters

Name Explanation
DeviceValue The device context or the raster image data (i.e. Hdc or ImageHandle) depending on the DeviceMode parameter
left, top The x, y coordinates of the top left corner of the rectangle
right, bottom The x, y coordinates of the bottom right corner of the rectangle
EnableFontScale Scales the font so the text fits within the specified rectangle. [True (nonzero): Fonts are scaled, False (0): Fonts are not scaled]
Clip Clips the text that does not fit within the specified rectangle [True (nonzero): Text is clipped, False(0):Text is not clipped]
DeviceMode If 0 (ikScreen), then the output will be drawn in pixel units. If 1 (ikPrinter), the output will be drawn in 0.1mm units. If 2 (ikMemoryHandle), the output will be drawn (in pixel units) to the image data according to the DeviceValue parameter

The following constants can be used: (ikScreen = 0, ikPrinter = 1, ikMemoryHandle = 2).

Return Value

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

Explanation

The DrawText method draws text in a rectangle specified in the designated object (the screen, printer, or image data). The (left, top), and (right, bottom) parameters specify the location of a rectangle in which the text is drawn. If the EnableFontScale parameter is True (nonzero) and the specified text is unable to fit within the rectangle, it will be scaled to fit. However, after scaling if the text still will not fit within the rectangle, the text will be clipped. If the EnableFontScale parameter is False (0), the font will be used as is without scaling. If the text does not fit within the rectangle, the text will be continued on a new line with the line break occuring at a space. (CRLF can also be used). If the Clip parameter is True (nonzero), the characters of the text that do not fit within the specified rectangle will be cut. If the Clip parameter is False (0), then all of the characters in the text will be drawn even if they do not fit inside the rectangle.

Regardless of the text direction or the rotation of the characters, text will be drawn from the start position to the right (or down in the case of vertical text).

When using the DrawText method the following properties should be set: CharSet, TextColor1, TextColor2, FontName, FontSize, Transparent, Direction, CharAngle, CharExtra, HCentering, VCentering, HotkeyPrefix, Text . The CharAngle property is enabled for 0, 90, 180, and 270 degree rotations only. When the EnableFontScale parameter is False (0), the CharAngle, Drection, and VCentering properties are disabled. When the HotkeyPrefix property is set to values other than 1, prefixed string functionality cannot be used.

If the DeviceMode parameter is 0 or 2 (the designated object is the screen or the image data) then the left, top, right, bottom parameters are in pixel units.

If the DeviceMode parameter is 1 (the designated object is the printer) then the left, top, right, bottom parameters are in 0.1mm units.

Differences between the ImageKit7/8

The DeviceValue argument's type has changed.

The ImageKit9 ActiveX is a product created by Newtone Corporation