This method draws text in a rectangle specified in the designated object (the screen, printer, or image data).
[TVIkOutPutDeviceMode Type]
Unit
IkInit
type
TVIkOutPutDeviceMode = (vikScreen,
vikPrinter, vikMemoryHandle);
Parameters
Name | Explanation |
---|---|
DeviceValue | The device context or the raster image data depending on the DeviceMode parameter |
ALeft, ATop | The x, y coordinates of the top left corner of the bounding rectangle |
ARight, ABottom | The x, y coordinates of the bottom right corner of the bounding rectangle |
ARect | The x, y coordinates of the bounding rectangle |
EnableFontScale | Scales the font so the text fits within the specified rectangle. [True: Fonts are scaled, False: Fonts are not scaled] |
Clip | Clips the text that does not fit within the specified rectangle [True: Text is clipped, False:Text is not clipped] |
DeviceMode | If 0 vikScreen, then the output will be drawn in pixel units. If 1 vikPrinter, the output will be drawn in 0.1mm units. If vikMemoryHandle, the output will be drawn (in pixel units) to the image data according to the DeviceValue parameter |
Use either ALeft, ATop, ARight, ABottom or ARect.
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The DrawText method draws text in a rectangle specified in the designated object (the screen, printer, or image data). The (ALeft, ATop), and (ARight, ABottom) parameters specify the location of a rectangle in which the text is drawn. If the EnableFontScale parameter is True 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, 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, the characters of the text that do not fit within the specified rectangle will be cut. If the Clip parameter is False, 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 vikScreen or vikMemoryHandle, then the ALeft, ATop, ARight, ABottom, (or ARect), X1, Y1, X2, Y2 parameters are in pixel units.
If the DeviceMode parameter is vikPrinter, then the ALeft, ATop, ARight, ABottom, (or ARect), X1, Y1, X2, Y2 parameters are in 0.1mm units.
Differences between the ImageKit7/8/9/10
In VCL the constants contain a "v". In ActiveX, the constants
are: ikScreen, ikPrinter, ikMemoryHandle.
Methods that pass a TRect type have been added.