Text |
public class TextBlockVisual3D : BaseVisual3D, IDisposable
The TextBlockVisual3D type exposes the following members.
Name | Description | |
---|---|---|
TextBlockVisual3D | Creates a new instance of TextBlockVisual3D | |
TextBlockVisual3D(String) | Creates a new instance of TextBlockVisual3D |
Name | Description | |
---|---|---|
Background | Gets or sets the Brush that fill the background of the textBorder. | |
BackMaterial | Gets a Material that is used to show the text and border on the back side of the plane model defined by the textGeometryModel3D. Back material can be changed from a derived class with changing the protected backMaterial field. | |
BorderBrush | Gets or sets the Brush of the border. | |
BorderSize | Gets or sets a Size that can be set to define the 2D size of the Border element. By default BorderSize is set to Size.Empty. This automatically scales the Border element to show the whole TextBlock element. But when you want to trim the text, you need to set the BorderSize to a valid size value. | |
BorderThickness | Gets or sets the thickness of the border. | |
FontFamily | Gets or sets the FontFamily of the text. | |
FontSize | Gets or sets the size of the text | |
FontWeight | Gets or sets the FontWeight of the text. | |
Foreground | Gets or sets the foreground brush of the text. | |
Inlines | Gets InlineCollection from the TextBlock Inlines property. This property can be used to show text with different colors and fonts. After Inlines are manually added, you need to call Refresh method to update the size and rendering of the TextBlockVisual3D. | |
IsBackSidedTextFlipped | Gets or sets a Boolean that specifies if the text on the back side is horizontally flipped so that it appears correct when viewing from the back side. When false (by default), the text on front and back side is the same. This property has effect only when IsTwoSidedText property is set to true. | |
IsDisposed | Gets a Boolean that specified is this TextBlockVisual3D has been disposed. | |
IsTwoSidedText | Gets or sets a Boolean that specifies if the plane 3D models shows text on both front and back sides. If IsTwoSidedText is false, then only the front material is set. This can improve performance because the text is rendered only once. Default value is true. To control orientation of the back sided text, see also the IsBackSidedTextFlipped property. | |
Material | Gets a Material that is used to show the text and border on the front side of the plane model defined by the textGeometryModel3D. Front material can be changed from a derived class with changing the protected frontMaterial field. | |
Position | Gets or sets the position of the text. What point on 3D model is represented by this property is specified by PositionType property (TopLeft by default). | |
PositionType | Gets or sets a PositionTypes the what point on the 3D model the Position property represents. Default value is TopLeft. | |
RenderBitmapSize | When set to a valid size value (not Empty or with 0 Width or Height), then TextBlock and Border elements are rendered to bitmap and that bitmap is then shown on a 3D model. When set to Empty then TextBlockVisual3D is using a DiffuseMaterial with a VisualBrush that show TextBlock and Border. Setting RenderBitmapSize can increase initialization time but can significantly improve rendering performance. When used in DXEngine it is highly recommended to set this property. Default value is Size.Empty; but when rendered with Ab3d.DXEngine the default value is set to DefaultDXEngineRenderBitmapSize (512 x 256). | |
Size | Gets or sets a Size of the 3D plane model that will show the text. When the Size is Empty (by default), the BorderSize will be used. If BorderSize is also Empty, then TextBlock will be measured and its desired size will be used. It is also possible to set only Size.Height and leave Size.Width 0 or NaN. In this case the used width will be calculated from BorderSize or TextBlock size. This way it is easy to specify only the desired text height in 3D space and the TextBlockVisual3D will automatically calculate the width of the model. | |
Text | Gets or sets the text that is displayed with 3D lines. | |
TextAlignment | Gets or sets a value that indicates the horizontal alignment of text content. | |
TextDirection | Gets or sets the Vector3D that is pointing in the direction in which the text is drawn. Default value is (1,0,0). | |
TextHorizontalAlignment | Gets or sets a HorizontalAlignment that specifies the horizontal alignment of the TextBlock inside the Border element. BorderSize property needs to be set for this property to have any effect. Default value is Left. | |
TextPadding | Gets or sets a Thickness that specifies the padding of the TextBlock element inside the textBorder element. | |
TextTrimming | Gets or sets the TextTrimming of the text. This property will have no effect if BorderSize is not set because the default behavior without BorderSize set is to adjust the size of the text to fit the allotted space. Note that if this property is set to TextTrimming.CharacterEllipsis and the text consists of multiple lines of text where each line is separated by a line feed, then an ellipsis will appear on each line that exceeds the allocated space. See also TextWrapping property. | |
TextVerticalAlignment | Gets or sets a VerticalAlignment that specifies the horizontal alignment of the TextBlock inside the Border element. BorderSize property needs to be set for this property to have any effect. Default value is Center. | |
TextWrapping | Gets or sets the TextBlockVisual3D should wrap the text. Default is NoWarp. For TextWrapping to have effect, you need to set the BorderSize property (it should not be set to Size.Empty). | |
UpDirection | Gets or sets the Vector3D that is pointing in the text's up direction. Default value is (0,1,0). | |
UseMatrixTransform3D | When UseMatrixTransform3D is true then this TextBlockVisual3D is created with a standard and shared MeshGeometry3D and uses a UseMatrixTransform3D to position, scale and orient the plane to the desired location, size and direction. This gives a big performance improvement. When false, each TextBlockVisual3D is using a unique MeshGeometry3D that is updated according to the position, scale and direction. This means that on each property change a new MeshGeometry3D is created. Default value is true. |
Name | Description | |
---|---|---|
AlignWithCamera(BaseCamera) | AlignWithCamera method aligns the TextBlockVisual3D to be oriented so that it faces the specified camera. | |
AlignWithCamera(ProjectionCamera) | AlignWithCamera method aligns the TextBlockVisual3D to be oriented so that it faces the specified camera. | |
CreateModel |
Creates this Model3D
(Overrides BaseVisual3DCreateModel) | |
Dispose | Dispose method frees the VisualBrushes and RenderTargetBitmaps that are created by this TextBlockVisual3D object. | |
OnBorderPropertyChanged | OnBorderPropertyChanged | |
OnPlaneMeshPropertyChanged | OnPlaneMeshPropertyChanged | |
OnRenderBitmapSizePropertyChanged | OnRenderBitmapSizePropertyChanged | |
OnTextBlockPropertyChanged | OnTextBlockPropertyChanged | |
OnVisualParentChanged |
OnVisualParentChanged
(Overrides BaseVisual3DOnVisualParentChanged(DependencyObject)) | |
Refresh | Refresh method measures and recreates the elements and 3D models. | |
UpdateBorder | UpdateBorder method updates the properties of the textBorder Border element. This method can be overridden by a derived class to allow applying custom settings on the Border element. | |
UpdatePlaneMesh | UpdatePlaneMesh sets the value of textGeometryModel3D.Geometry with a new MeshGeometry3D. The new MeshGeometry3D represents the plane where the text texture will be shown. The plane is defined by the CenterPosition, Size, TextDirection and UpDirection properties. This method can be overridden by a derived class to provide custom MeshGeometry3D. | |
UpdateTextBlock | UpdateTextBlock method updates the properties of the textBlock TextBlock element. This method can be overridden by a derived class to allow applying custom settings on the TextBlock element. |
Name | Description | |
---|---|---|
BackgroundProperty | BorderThicknessProperty | |
backMaterial | frontMaterial is a Material that is used to show the text and border on the back side of the plane model defined by the textGeometryModel3D. | |
backTextVisualBrush | backTextVisualBrush is VisualBrush that is used to show Border and TextBlock on a the back side of the 3D model. | |
BorderBrushProperty | BorderThicknessProperty | |
BorderSizeProperty | BorderSizeProperty | |
BorderThicknessProperty | BorderThicknessProperty | |
DefaultDXEngineRenderBitmapSize | DefaultDXEngineRenderBitmapSize defines the RenderBitmapSize that is used in case TextBlockVisual3D is rendered with Ab3d.DXEngine and user does not specify its own value for RenderBitmapSize. By default the Size is set to 512 x 256. | |
FontFamilyProperty | FontSizeProperty | |
FontSizeProperty | FontSizeProperty | |
FontWeightProperty | FontWeightProperty | |
ForegroundProperty | ForegroundProperty | |
frontMaterial | frontMaterial is a Material that is used to show the text and border on the front side of the plane model defined by the textGeometryModel3D. | |
IsBackSidedTextFlippedProperty | IsBackSidedTextFlippedProperty | |
IsTwoSidedTextProperty | IsTwoSidedTextProperty | |
PositionProperty | PositionProperty | |
PositionTypeProperty | PositionTypeProperty | |
RenderBitmapSizeProperty | RenderBitmapSizeProperty | |
SizeProperty | SizeProperty | |
TextAlignmentProperty | TextAlignmentProperty | |
textBlock | TextBlock used to define how the text is rendered | |
textBorder | textBorder is a parent Border element to textBlock and is used to define the border of the TextBlock. | |
TextDirectionProperty | TextDirectionProperty | |
textGeometryModel3D | textGeometryModel3D defines the GeometryModel3D that is shown with this TextBlockVisual3D. This GeometryModel3D is set to the Content property. | |
TextHorizontalAlignmentProperty | TextHorizontalAlignmentProperty | |
TextPaddingProperty | TextPaddingProperty | |
TextProperty | TextProperty | |
TextTrimmingProperty | TextTrimmingProperty | |
TextVerticalAlignmentProperty | TextVerticalAlignmentProperty | |
textVisualBrush | textVisualBrush is VisualBrush that is used to show Border and TextBlock on a 3D model. | |
TextWrappingProperty | TextWrappingProperty | |
UpDirectionProperty | UpDirectionProperty |
Name | Description | |
---|---|---|
DumpHierarchy |
Display details about the hierarchy of Visual3D children to Debug console (for example to Visual Studio's Immediate window).
(Defined by Extensions) | |
ForEachGeometryModel3D |
Performs the specified action on each GeometryModel3D inside the rootModelVisual3D.
(Defined by Extensions) | |
ForEachVisual3D |
Performs the specified action on each ModelVisual3D inside the rootModelVisual3D.
(Defined by Extensions) | |
GetName |
Gets name of the Visual3D that was previously set by SetName extension method.
(Defined by Extensions) | |
SetName |
Sets Name property to Visual3D. Note that if name is not correct for WPF, it can be corrected (name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores).
In this case the SetName method will set the corrected name to the object and return false (in this case you can call GetName to get the corrected name). True is returned when the original name is set to the object.
(Defined by Extensions) |