TextVisualizer Class
A visualizer that draws texts and font symbols.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class TextVisualizer : PointVisualizer
Remarks
A TextVisualizer draws features as text labels or symbols loaded from TrueType or OpenType fonts, in both 2D and 3D. It can be applied to point, line and polygon features, all other feature types are ignored. Like all PointVisualizer types, it can be repeated along lines and polygon edges, and can also be rotated with the features.
The most common use for a TextVisualizer is for presenting a string attribute as a text on a map. To do this, set the Text property to get its value from the string attribute. The text may be drawn with a halo or a background box, to increase contrast and improve readability.
In 2D, the text may be scaled, rotated and offset in X and Y. If applied to a line or polygon, the direction of the line or polygon edge may be added to the rotation; a line that is directed up (north) rotates the text 0 degrees. The text may also be shifted horizontally and vertically with the AlignX and AlignY properties.
In 3D, the text always faces the viewer, any rotation from the feature is ignored. The OffsetZ parameter is first applied to the insertion point, in view coordinates. If the length unit is pixels, the scale, rotation and offset parameters are then applied in pixel coordinates, i.e. they work just like in 2D. The size of the text will be independent of the distance to the object. If the length unit is nominal meters or view length units, the X and Y offsets will be applied in view coordinates, and the scaling will depend on the distance to the object so that texts far away are smaller than texts near the viewer. Rotation and alignments still work as in 2D.
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ResourceObject
Visualizer
PointVisualizer
TextVisualizer
Platforms
Windows, Linux, Android
TextVisualizer Members
The TextVisualizer type has the following members.
Constructors
Name | Description |
---|---|
TextVisualizer | Initializes a new instance of the TextVisualizer class. |
Properties
Name | Description |
---|---|
AlignX | Gets or sets a value specifying how the text is horizontally aligned with the feature. |
AlignY | Gets or sets a value specifying how the text is vertically aligned with the feature. |
AntiAlias | Gets or sets a flag indicating if antialiasing should be used to remove aliasing artifacts by smoothing the pixels. Inherited from PointVisualizer |
At | Gets or sets a value that determines the placement of an object along lines. Inherited from PointVisualizer |
AtCenter | Gets or sets a value indicating if the TextVisualizer is applied to the center of a polygon feature, or along the edge. Inherited from PointVisualizer |
AzimuthRotation | Gets or sets a value indicating whether the Rotation angle starts from true north. Inherited from PointVisualizer |
BackgroundColor | Gets or sets the color to use for the background box. |
BackgroundOutlineColor | Gets or sets the color to use for the outline of the background box. |
BackgroundOutlineWidth | Gets or sets the width of the background box outline. |
BackgroundPadding | Gets or sets a value specifying how much extra space should be added between the text and the edges of the background box. |
CharacterIndex | Gets or sets a value indicating that a single character from the selected font should be drawn. |
ClipToViewArea | Gets or sets a value indicating if the feature should be clipped to the visible view area before the visualizer is applied. Inherited from PointVisualizer |
Color | Gets or sets the color used to draw the features. Inherited from PointVisualizer |
Condition | Gets or sets a condition that must evaluate to true if the visualizer shall be applied to a feature. Inherited from Visualizer |
FollowLine | Gets or sets a value indicating that the text should follow line features. |
Font | Gets or sets the font to use. |
HaloColor | Gets or sets the color to use for drawing the text halo. |
HaloWidth | Gets or sets a value specifying the width of the text halo. |
IsDisposed | Gets a value that tells whether the current TextVisualizer has been disposed. Inherited from EngineObject |
LabelOrganizingSettings | Gets or sets the settings that control how the rendering will be affected by a LabelOrganizingLayer. Inherited from PointVisualizer |
LeadLine | Gets or sets a value indicating if a lead line should be drawn for offset objects. Inherited from PointVisualizer |
LeadLineSettings | Gets or sets properties controlling how lead lines are drawn. Inherited from PointVisualizer |
LengthUnit | Gets or sets a value defining the length unit of some other properties. Inherited from PointVisualizer |
Name | Gets or sets the name of the TextVisualizer. Inherited from ResourceObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current TextVisualizer represents. Inherited from EngineObject |
OffsetX | Gets or sets a value offsetting the visualization of an object from its geographic position. Inherited from PointVisualizer |
OffsetY | Gets or sets a value offsetting the visualization of an object from its geographic position. Inherited from PointVisualizer |
OffsetZ | Gets or sets a value offsetting the visualization of an object from its geographic position. Inherited from PointVisualizer |
Opacity | Gets or sets a value that specifies the opacity of the features. Inherited from PointVisualizer |
PickingSupport | Gets or sets a value specifying how much information is maintained when the visualizer creates a PresentationObject for a feature. Inherited from Visualizer |
RenderingPriority | Get or sets how the visualization is prioritized. Inherited from PointVisualizer |
Repeat | Gets or sets a value determining the placement of an object along lines and polygon edges. Inherited from PointVisualizer |
RingOrientation | Gets or sets the desired orientation of polygon rings and closed line features. Inherited from PointVisualizer |
Rotation | Gets or sets a value specifying the direction of the object. Inherited from PointVisualizer |
RotationMode | Gets or sets a value that indicates how a label or symbol is rotated. Inherited from PointVisualizer |
Scale | Gets or sets a value controlling the size of the visualization. Inherited from PointVisualizer |
Text | Gets or sets the text to draw. |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
WordWrap | Gets or sets the maximum line length when the text is drawn. |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Draw | Draws a feature on a drawable. Inherited from Visualizer |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from Visualizer |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from Visualizer |
GetImage | Renders a feature onto a bitmap and returns it. Inherited from PointVisualizer |