Click or drag to resize

ZebraGraphics.DrawText Method (String, Font, Color, Int32, Int32, Int32, Int32, Int32, TextAlignment, TextAlignment, Boolean)

Draws the text into the specified rectangle using the specified alignments, optionally reducing the size of the font to fit the specified rectangle.

Namespace:  Zebra.Sdk.Card.Graphics
Assembly:  SdkApi_Card_Desktop (in SdkApi_Card_Desktop.dll) Version: 2.14.1989
Syntax
void DrawText(
	string text,
	Font font,
	Color color,
	int x,
	int y,
	int width,
	int height,
	int angle,
	TextAlignment horizontal,
	TextAlignment vertical,
	bool shrinkToFit
)

Parameters

text
Type: System.String
The text to be drawn.
font
Type: System.Drawing.Font
The font type.
color
Type: System.Drawing.Color
The text color.
x
Type: System.Int32
The x coordinate.
y
Type: System.Int32
The y coordinate.
width
Type: System.Int32
The width of the rectangle.
height
Type: System.Int32
The height of the rectangle.
angle
Type: System.Int32
The angle of the the text to be drawn (center rotated).
horizontal
Type: Zebra.Sdk.Card.Graphics.Enumerations.TextAlignment
The horizontal alignment of the text.
vertical
Type: Zebra.Sdk.Card.Graphics.Enumerations.TextAlignment
The vertical alignment of the text.
shrinkToFit
Type: System.Boolean
True to reduce the font size to fit the specified width and height.
Exceptions
ExceptionCondition
ZebraIllegalArgumentExceptionIf there is an error with the provided arguments.
ZebraCardExceptionIf an error occurs while rendering the text.
See Also