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.
TXTextControl.Drawing.MenuItem The Drawing.MenuItem class represents a bindable Windows Forms ToolStripMenuItem.
TXTextControl.Drawing.ShapesContextMenuStrip The Drawing.ShapesContextMenuStrip class represents the default context menu of the Windows Forms TXDrawingControl.
TXTextControl.Drawing.TXDrawingControl The TXDrawingControl class implements a Windows Forms control with features to draw custom or predefined shapes.
TXTextControl.Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemEventArgs The RibbonListViewItemEventArgs class provides data for the RibbonListView.EditItemTextBoxActivated, RibbonListView.EditItemTextBoxDeactivated, RibbonListView.ItemClick, ItemMouseEnter or ItemMouseLeave 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.
TXTextControl.Drawing.TXDrawingControl Initializes a new instance of the TXDrawingControl 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.
TXTextControl.TextControl.DrawingActivated Occurs when a drawing has been activated.
TXTextControl.TextControl.DrawingClicked Occurs when a drawing has been clicked on.
TXTextControl.TextControl.DrawingCreated Occurs when a new drawing has been created.
TXTextControl.TextControl.DrawingDeleted Occurs when a drawing has been deleted.
TXTextControl.TextControl.DrawingDeactivated Occurs when a drawing has been deactivated.
TXTextControl.TextControl.DrawingDeselected Occurs when a drawing has been deselected.
TXTextControl.TextControl.DrawingDoubleClicked Occurs when a drawing has been doubleclicked on.
TXTextControl.TextControl.DrawingMoved Occurs when a drawing has been moved.
TXTextControl.TextControl.DrawingRightClicked Occurs when a drawing has been clicked on with the right mouse button.
TXTextControl.TextControl.DrawingSelected Occurs when a drawing has been selected.
TXTextControl.TextControl.DrawingSized Occurs when a drawing has been sized.
TXTextControl.Drawing.TXDrawingControl.AdaptBounds Indicates that the visible bounds of the displayed shapes have been changed (by changing the shape's angle, outline width, yellow adjust rectangles or the control's border width) in so far that the control requires an update of its bounds.
TXTextControl.Drawing.TXDrawingControl.Changed Indicates that the number or formatting of the displayed shapes has been changed.
TXTextControl.Drawing.TXDrawingControl.ShapeAdjusted Occurs when a shape has been adjusted by using its yellow adjust rectangle.
TXTextControl.Drawing.TXDrawingControl.ShapeClicked Occurs when a shape has been clicked on.
TXTextControl.Drawing.TXDrawingControl.ShapeCreated Occurs when a new shape has been created.
TXTextControl.Drawing.TXDrawingControl.ShapeDeleted Occurs when a shape has been deleted from the TX Drawing Control's shapes collection.
TXTextControl.Drawing.TXDrawingControl.ShapeDeselected Occurs when a shape has been deselected.
TXTextControl.Drawing.TXDrawingControl.ShapeFlipped Occurs when a shape has been flipped.
TXTextControl.Drawing.TXDrawingControl.ShapeFormatChanged Occurs when shape formatting attributes which cannot be handled with the built-in mouse interface have been changed.
TXTextControl.Drawing.TXDrawingControl.ShapeMoved Occurs when a shape has been moved with the built-in mouse interface.
TXTextControl.Drawing.TXDrawingControl.ShapeSelected Occurs when a shape has been selected.
TXTextControl.Drawing.TXDrawingControl.ShapeSized Occurs when a shape has been sized with the built-in mouse interface.
TXTextControl.Drawing.TXDrawingControl.ViewChanged Occurs when UI manipulations such as shape moving or selection changing have caused the view to change.

Methods

Method Description
TXTextControl.ServerTextControl.OnDrawingCreated Raises the DrawingCreated event.
TXTextControl.ServerTextControl.OnDrawingDeleted Raises the DrawingDeleted event.
TXTextControl.TextControl.DrawingLayoutDialog Invokes the built-in dialog box for alter the layout settings, the size and the text distances of a drawing.
TXTextControl.TextControl.OnDrawingActivated Raises the DrawingActivated event.
TXTextControl.TextControl.OnDrawingClicked Raises the DrawingClicked event.
TXTextControl.TextControl.OnDrawingCreated Raises the DrawingCreated event.
TXTextControl.TextControl.OnDrawingDeactivated Raises the DrawingDeactivated event.
TXTextControl.TextControl.OnDrawingDeleted Raises the DrawingDeleted event.
TXTextControl.TextControl.OnDrawingDeselected Raises the DrawingDeselected event.
TXTextControl.TextControl.OnDrawingDoubleClicked Raises the DrawingDoubleClicked event.
TXTextControl.TextControl.OnDrawingMoved Raises the DrawingMoved event.
TXTextControl.TextControl.OnDrawingRightClicked Raises the DrawingRightClicked event.
TXTextControl.TextControl.OnDrawingSelected Raises the DrawingSelected event.
TXTextControl.TextControl.OnDrawingSized Raises the DrawingSized 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.
TXTextControl.Drawing.TXDrawingControl.ClearUndo Clears the undo buffer of the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.Copy Copies the current selected shapes of the TX Drawing Control to the Clipboard.
TXTextControl.Drawing.TXDrawingControl.Cut Moves the current selected shapes of the TX Drawing Control to the Clipboard.
TXTextControl.Drawing.TXDrawingControl.FormatShapesDialog Opens a dialog to format selected shapes.
TXTextControl.Drawing.TXDrawingControl.Load Loads shapes data into the TX Drawing Control from a specified object of type System.IO.Stream.
TXTextControl.Drawing.TXDrawingControl.Paste Pastes the content of the clipboard into the TX Drawing Control
TXTextControl.Drawing.TXDrawingControl.PrintPaint Renders the displayed shapes on the specified System.Drawing.Graphics object.
TXTextControl.Drawing.TXDrawingControl.Redo Redoes the last TX Drawing Control operation.
TXTextControl.Drawing.TXDrawingControl.Save Saves the shapes data to the given object of type System.IO.Stream.
TXTextControl.Drawing.TXDrawingControl.SaveImage Saves the displayed shapes as an image.
TXTextControl.Drawing.TXDrawingControl.SelectAll Selects all shapes in the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.SizeToContent If any changes of the the displayed shapes' visible bounds require an adaption of the TX Drawing Control bounds, the size and/or location of the control is expanded respectively decreased by the considering value of the considering shape's side(s).
TXTextControl.Drawing.TXDrawingControl.Undo Undoes the last edit operation in the TX Drawing Control.

Properties

Property Description
TXTextControl.ServerTextControl.Drawings Gets a collection of all drawings in a document.
TXTextControl.TextControl.DrawingMarkerLines Specifies whether a marker frame is shown around a drawing to indicate its position and size.
TXTextControl.TextControl.Drawings Gets a collection of all drawings contained in the text part with the input focus.
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.
TXTextControl.Drawing.ShapesContextMenuStrip.SelectedShapesMenuItems Returns an array of System.Windows.Forms.ToolStripItem objects that represents those items which are displayed in the context menu strip when the control is right clicked inside a shape.
TXTextControl.Drawing.ShapesContextMenuStrip.StandardMenuItems Returns an array of System.Windows.Forms.ToolStripItem objects that represents those items which are displayed in the context menu strip when the control is right clicked outside a shape.
TXTextControl.Drawing.TXDrawingControl.BackColor Gets or sets the TX Drawing Control's back color.
TXTextControl.Drawing.TXDrawingControl.BorderColor Gets or sets the TX Drawing Control's border line color.
TXTextControl.Drawing.TXDrawingControl.BorderWidth Gets or sets the TX Drawing Control's border line width.
TXTextControl.Drawing.TXDrawingControl.CanCopy Informs whether shapes are selected which can be copied to the internal clipboard.
TXTextControl.Drawing.TXDrawingControl.CanPaste Informs whether the internal clipboard contains shapes that can be pasted into the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.CanRedo Informs whether an operation can be re-done using the Redo method.
TXTextControl.Drawing.TXDrawingControl.CanUndo Gets a value indicating whether the user can undo the previous operation in the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.IsCanvasVisible Gets a value whether the TX Drawing Control is interpreted as canvas or not.
TXTextControl.Drawing.TXDrawingControl.Selection Gets an object of type Drawing.Selection that represents the current selected shapes inside the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.Shapes Gets an object of type ShapeCollection that represents those shapes which are displayed inside the TX Drawing Control.
TXTextControl.Drawing.TXDrawingControl.ZoomFactor Gets or sets the zoom factor, in percent, for the TX Drawing Control.
TXTextControl.Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemEventArgs.Item Gets an object of type RibbonListViewItem that represents the handled item.