- In This Section
- Text Features
- Font Features
- Applying Actions (Imaging Effects) on ImageElement objects
TextElement
A TextElement – represented by Neodynamic.WebControls.ImageDraw.TextElement class – simply wraps a text string that must be drawn on the Canvas. TextElement objects are created by specifying some basic properties such as Text, Font, ForeColor, StrokeColor, etc.
Text Features
The main features and properties of TextElement objects are the following:
- AutoSize
When this feature is enabled (it has been set to True), then the TextElement object is automatically resized to display its entire contents. - Multi-line Text
When this feature is enabled (Multiline property has been set to True), then the text can span more than one line. - Outlined Text
TextElement objects support outlined text by setting up the width of the border along the outline of the text through out StrokeWidth property. In addition, you can specify the color of the border by setting up the StrokeColor property.
TextElement objects also allow multi-stroking i.e. you can specify more than one border including its thickness and color by using MultiStrokeWidths and MultiStrokeColors properties. - Text Color
The ForeColor property of TextElement objects is used for specifying the foreground color of the text and StrokeColor property is used for specifying the color of the border along the outline of the text if StrokeWidth property is greater than zero. - Text Alignment
If AutoSize property is disabled, then the text can be aligned inside the TextElement's bound which is determined by its X, Y, Width and Height properties. The text can be left-aligned, center-aligned, or right-aligned in both vertical and horizontal directions.
Syntax sample:
TextElement Output Sample:
TextElement Output Sample:
Font Features
TextElement objects support rich font formatting allowing you to use server's installed fonts as well as custom font files (*.ttf) that are stored in your website folders. In addition, you can configure the text font so it's bold, italic, underline, etc; as well as the size and unit of measure (Point, Inch, Millimeter, or Pixel). Learn more about Font settings.
Applying Actions (Imaging Effects) on TextElement objects
TextElement are useful for drawing custom captions and watermarks; and as just for ImageElement objects, TextElement objects can be "affected" by more than one Action due to they feature an Actions property of type Neodynamic.WebControls.ImageDraw.ActionCollection.
Learn more about Actions.