TX Text Control .NET for WPF

DrawingFrame Class

Class|Introduced in 23.0
Namespace
TXTextControl.DataVisualization
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. FrameBase
  2. DrawingFrame

Description

An instance of the DrawingFrame class represents a drawing and its layout in a Text Control document. A drawing can be positioned in the document like an image or a textframe, either geometrically or as a single character. Geometrically its position can either be relative to a paragraph to which it is anchored or relative to the complete document. The DrawingFrame class handles the positioning of the drawing in the document. A drawing frame is always associated with a drawing control of the type TXTextControl.Drawing.TXDrawingControl or TXTextControl.WPF.Drawing.TXDrawingControl. This drawing control handles the appearance and the data of the drawing. A drawing control can be activated so that its contents can be edited. Activation occurs either through a mouse double-click or through programming code with the Activate method. All drawings in a document are contained in a DrawingCollection. The collection can also be used to add drawings to or to remove drawings from the document. The drawing collection can be obtained through the TextControl.Drawings, WPF.TextControl.Drawings or ServerTextControl.Drawings property.

Syntax

public class DrawingFrame : FrameBase

Examples

The following example creates a Drawing Frame instance and configures its export compression quality setting for a document workflow.

TXTextControl.DataVisualization.DrawingFrame drawingFrame = new("Approved");
drawingFrame.ExportCompressionQuality = 90;

Members

Constructors

ConstructorDescription
DrawingFrameInitializes a new instance of the DrawingFrame class.

Properties

PropertyDescription
AlignmentGets or sets the frame's horizontal alignment when it is anchored to a paragraph. (Inherited from FrameBase.)
BoundsGets the frame's bounding rectangle relative to the upper left corner of the document. (Inherited from FrameBase.)
DescriptiveTextGets or sets a descriptive text for the frame. An empty string indicates that the frame has no such text. An empty string can also be used to delete a previously set text. (Inherited from FrameBase.)
DrawingGets the drawing control associated with the drawing frame. It must be of the type TXTextControl.Drawing.TXDrawingControl or TXTextControl.WPF.Drawing.TXDrawingControl.
ExportCompressionQualitySets a value between 1 and 100, which is the quality of a lossy data compression used, if the drawing's bitmap image is exported. It is only used, if the image data is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. If this property is set to zero, which is the default value, Text Control uses the quality value set with the SaveSettings.ImageCompressionQuality property.
ExportFileNameGets or sets the file name, when the drawing's bitmap image is exported. An empty string indicates that no export filename has currently be specified for the drawing's image. In this case a constructed filename is used. A filename is constructed in the following form: <document_filename>_<number>.<extension>. The technical article Loading and Saving Images describes where newly created image files are stored.
ExportFilterIndexGets or sets the format used, if a drawing's bitmap image is exported. This is the number of the filter in the string returned through the ImageCollection.ExportFilters property, beginning with number one. A value of zero indicates that no export format has currently be specified for the drawing. In this case the drawing's image is saved in Windows Bitmap format. The technical article Loading and Saving Images lists the currently possible values for this property.
ExportResolutionGets or sets the maximum resolution in dots per inch in which the drawing's bitmap image is saved. If this property's value is zero, which is the default value, Text Control uses the resolution value set with the SaveSettings.ImageMaxResolution property.
IDGets or sets an identifier for the frame. It must be a one-based value. A value of zero indicates that the image, text frame, chart, barcode or drawing has no identifier. Zero can also be used to delete a previously set identifier. (Inherited from FrameBase.)
InsertionModeGets or sets a value determining whether the frame is treated as a single character or the document's text either flows around or overwrites the frame. If the document's text flows around or overwrites the frame, this property also determines whether the image, text frame, chart, barcode or drawing is moved with the text or fixed positioned on a page. (Inherited from FrameBase.)
LocationGets or sets, in twips, the frame's current location. If the image, text frame, chart, barcode or drawing is anchored to a paragraph, the location is relative to the paragraph. Otherwise, it is relative to the document. If the frame has a horizontal alignment or if it is inserted inline, this property returns zero. This property cannot be set for images, text frames, charts, barcodes or drawings which are inserted inline. (Inherited from FrameBase.)
MoveableDetermines whether a frame can be moved in the document at run time with the built-in mouse interface. (Inherited from FrameBase.)
NameGets or sets a name for the frame. An empty string indicates that the frame has no name. An empty string can also be used to delete a previously set name. (Inherited from FrameBase.)
SaveModeDetermines whether the drawing's bitmap image is stored through its binary data or through a file reference. By default a drawing's image is stored with its binary data.
SizeGets or sets the frame's size in twips. For images this property is read only. (Inherited from FrameBase.)
SizeableDetermines whether the frame can be resized at run time with the built-in mouse interface. (Inherited from FrameBase.)
TextDistancesGets or sets the distances, in twips, between the frame and the document's text. The property's value is an array of four variables specifying the distances in the following order: left, top, right and bottom. If a value is set to -1, it is not changed. (Inherited from FrameBase.)
TextPositionRead only. Gets the frame's character position in the document's text (one-based). (Inherited from FrameBase.)

Methods

MethodDescription
ActivateActivates the drawing so that its contents can be edited. A drawing can only be activated, if the text part that contains the drawing has the input focus.
AddUndoUnitAdd the current state of the drawing which is connected with this DrawingFrame to the undo stack. Programmatic changes performed with the drawing's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the drawing frame's layout in the text is changed.
ChangeZOrderChanges the frame's z-order. (Inherited from FrameBase.)
RefreshRefreshes the drawing.