# DrawingFrame Class

> 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.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Inherits:** `TXTextControl.FrameBase`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DataVisualization > DrawingFrame Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/#members)

---

## In This Section

- [DrawingFrame.Activate Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/activate-method/llms.txt): Activates 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.
- [DrawingFrame.AddUndoUnit Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/addundounit-method/llms.txt): Add 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.
- [DrawingFrame Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/constructor/llms.txt): Initializes a new instance of the DrawingFrame class.
- [DrawingFrame.Drawing Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/drawing-property/llms.txt): Gets the drawing control associated with the drawing frame. It must be of the type TXTextControl.Drawing.TXDrawingControl or TXTextControl.WPF.Drawing.TXDrawingControl.
- [DrawingFrame.ExportCompressionQuality Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/exportcompressionquality-property/llms.txt): 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. 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.
- [DrawingFrame.ExportFileName Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/exportfilename-property/llms.txt): Gets 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.
- [DrawingFrame.ExportFilterIndex Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/exportfilterindex-property/llms.txt): Gets 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.
- [DrawingFrame.ExportResolution Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/exportresolution-property/llms.txt): Gets 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.
- [DrawingFrame.Refresh Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/refresh-method/llms.txt): Refreshes the drawing.
- [DrawingFrame.SaveMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/savemode-property/llms.txt): Determines 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.

---

## Nearby

- **Previous:** [DrawingEventArgs.DrawingFrame Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingeventargs/drawingframe-property/llms.txt)
- **Next:** [DrawingFrame.Activate Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/activate-method/llms.txt)
