Drawings and Shapes

TX Text Control supports the insertion of drawings and shapes. A drawing can be positioned like an image or 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.TXDrawingControl or WPF.Drawing.TXDrawingControl which handles the appearance and the data of the drawing. A drawing can be activated and its contained shapes can be altered through the user with built-in mouse and keyboard interfaces. A drawing control is also fully programmable, its contained shapes are accessible through a Drawing.ShapeCollection. 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. The TextControl.DrawingLayoutDialog and WPF.TextControl.DrawingLayoutDialog methods opens a dialog box, which offers layout settings such as positioning, size and text distances. A drawing can be saved and loaded with the TX Text Control format and the Microsoft Word format (.docx). With other formats the drawing's bitmap image is saved.

Classes

Class Description
TXTextControl.DataVisualization.DrawingCollection An instance of the DrawingCollection class contains all drawings in a document represented through objects of the type DataVisualization.DrawingFrame.
TXTextControl.DataVisualization.DrawingEventArgs The DrawingEventArgs class provides data for all events that occur with drawings.
TXTextControl.DataVisualization.DrawingFrame An instance of the DrawingFrame class represents a drawing and its layout in a Text Control document.
TXTextControl.Drawing.Selection The Drawing.Selection class represents all selected shapes.
TXTextControl.Drawing.Shape The Drawing.Shape class represents a shape which can be displayed inside the TX Drawing Control.
TXTextControl.Drawing.Shape.Fill The Drawing.Shape.Fill class determines the fill properties of a shape.
TXTextControl.Drawing.Shape.Outline The Drawing.Shape.Outline class determines the line properties of a shape.
TXTextControl.Drawing.ShapeCollection An instance of the ShapeCollection class contains all displayed shapes represented through objects of type Shape.
TXTextControl.Drawing.ShapeEventArgs The ShapeEventArgs class provides data for all events that occur with shapes.
TXTextControl.Drawing.ViewChangedEventArgs The ViewChangedEventArgs class provides data for the TXDrawingControl.ViewChanged event.

Constructors

Constructor Description
TXTextControl.DataVisualization.DrawingFrame Initializes a new instance of the DrawingFrame class.
TXTextControl.Drawing.Shape Initializes a new instance of the Shape class.

Events

Event Description
TXTextControl.ServerTextControl.DrawingCreated Occurs when a new drawing has been created.
TXTextControl.ServerTextControl.DrawingDeleted Occurs when a drawing has been deleted.

Methods

Method Description
TXTextControl.ServerTextControl.OnDrawingCreated Raises the DrawingCreated event.
TXTextControl.ServerTextControl.OnDrawingDeleted Raises the DrawingDeleted event.
TXTextControl.DataVisualization.DrawingCollection.Add Inserts a new drawing in a Text Control document.
TXTextControl.DataVisualization.DrawingCollection.CopyTo Copies the elements of the collection to an array, starting at a particular index.
TXTextControl.DataVisualization.DrawingCollection.DeactivateItem Deactivates the activated drawing and sets the input focus back to the text part that contains the drawing.
TXTextControl.DataVisualization.DrawingCollection.GetActivatedItem Returns the currently activated drawing.
TXTextControl.DataVisualization.DrawingCollection.GetItem Gets a particular drawing from the collection.
TXTextControl.DataVisualization.DrawingCollection.Remove Removes a drawing from a Text Control document.
TXTextControl.DataVisualization.DrawingFrame.Activate Activates the drawing so that its contents can be edited.
TXTextControl.DataVisualization.DrawingFrame.AddUndoUnit Add the current state of the drawing which is connected with this DrawingFrame to the undo stack.
TXTextControl.DataVisualization.DrawingFrame.Refresh Refreshes the drawing.
TXTextControl.Drawing.Selection.BringForward Increases the selected shapes' levels by one.
TXTextControl.Drawing.Selection.BringToFront Displays the selected shape as the uppermost shape of all shapes.
TXTextControl.Drawing.Selection.SendBackward Decreases the selected shapes' levels by one.
TXTextControl.Drawing.Selection.SendToBack Displays the selected shape as the lowest shape of all shapes.
TXTextControl.Drawing.Selection.IsCommonValueSelected Informs about whether an attribute from the Drawing.Selection.Attribute enumeration has the same value for the complete shapes selection.
TXTextControl.Drawing.Shape.FitToCanvas Expands the shape to the control's canvas size.
TXTextControl.Drawing.ShapeCollection.Add Adds an object of the type Shape to the collection.
TXTextControl.Drawing.ShapeCollection.Insert Inserts an object of the type Shape to the collection at a specified index.
TXTextControl.Drawing.ShapeCollection.Remove Removes an object of the type Shape from the collection.

Properties

Property Description
TXTextControl.ServerTextControl.Drawings Gets a collection of all drawings in a document.
TXTextControl.DataVisualization.DrawingEventArgs.DrawingFrame Gets an object that represents the drawing which causes the event.
TXTextControl.DataVisualization.DrawingFrame.Drawing Gets the drawing control associated with the drawing frame.
TXTextControl.DataVisualization.DrawingFrame.ExportCompressionQuality Sets a value between 1 and 100, which is the quality of a lossy data compression used, if the drawing's bitmap image is exported.
TXTextControl.DataVisualization.DrawingFrame.ExportFileName Gets or sets the file name, when the drawing's bitmap image is exported.
TXTextControl.DataVisualization.DrawingFrame.ExportFilterIndex Gets or sets the format used, if a drawing's bitmap image is exported.
TXTextControl.DataVisualization.DrawingFrame.ExportResolution Gets or sets the maximum resolution in dots per inch in which the drawing's bitmap image is saved.
TXTextControl.DataVisualization.DrawingFrame.SaveMode Determines whether the drawing's bitmap image is stored through its binary data or through a file reference.
TXTextControl.Drawing.Selection.CanBringForward Gets value that indicates whether the selected shapes' levels can be increased by one.
TXTextControl.Drawing.Selection.CanBringToFront Gets value that indicates whether the selected shape can be displayed as the uppermost shape of all shapes.
TXTextControl.Drawing.Selection.CanSendBackward Gets value that indicates whether the selected shapes' levels can be decreased by one.
TXTextControl.Drawing.Selection.CanSendToBack Gets value that indicates whether the selected shape can be displayed as the lowest shape of all shapes.
TXTextControl.Drawing.Selection.Shapes Gets or set the selected shapes .
TXTextControl.Drawing.Shape.Angle Gets or sets the angle of the shape inside the TX Drawing Control.
TXTextControl.Drawing.Shape.AutoSize Gets or sets a value indicating whether the shape is automatically resized with the TX Drawing Control.
TXTextControl.Drawing.Shape.Bounds Gets or sets the bounding rectangle of the shape.
TXTextControl.Drawing.Shape.CanFitToCanvas Gets a value which indicates whether the FitToCanvas method can be used or not.
TXTextControl.Drawing.Shape.Flip Gets or sets whether and in what form the shape is flipped.
TXTextControl.Drawing.Shape.Index Represents the index of the shape inside control's shape collection.
TXTextControl.Drawing.Shape.Movable Gets or sets a value which indicates whether the shape is movable or not.
TXTextControl.Drawing.Shape.IsSelected Gets a value which indicates whether the shape is selected or not.
TXTextControl.Drawing.Shape.Sizable Gets or sets a value which indicates whether the shape is sizable or not.
TXTextControl.Drawing.Shape.Location Gets or sets shape's current location.
TXTextControl.Drawing.Shape.ShapeFill Gets the shape's fill properties.
TXTextControl.Drawing.Shape.ShapeOutline Gets the shape's outline properties.
TXTextControl.Drawing.Shape.Size Gets or sets the shape's current size.
TXTextControl.Drawing.Shape.Type Gets or sets the shape's type.
TXTextControl.Drawing.Shape.Fill.Color Gets or sets the shape's fill color.
TXTextControl.Drawing.Shape.Outline.Color Gets or sets the shape's line color.
TXTextControl.Drawing.Shape.Outline.Width Gets or sets the shape's line width.
TXTextControl.Drawing.ShapeCollection.Item Gets an object of type Shape from the collection.
TXTextControl.Drawing.ShapeEventArgs.Shape Gets an object of type Shape that represents the shape which causes the event.
TXTextControl.Drawing.ViewChangedEventArgs.ClipRectangle Gets an object of type System.Drawing.Rectangle that represents the region where the control view is changed by UI editing.