Class MeasurementGraphics
Provides a lightweight graphics context optimized for measurement operations without rendering. Uses a shared memory device context for better performance than creating new graphics contexts.
Inheritance
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public class MeasurementGraphics : IDisposable
Remarks
Thread-safe implementation with thread-static fields ensuring each thread has its own memory DC. Uses reference counting to manage the lifetime of the memory device context.
Properties
Graphics
Gets the Graphics object associated with this measurement graphics context.
Declaration
public Graphics Graphics { get; }
Property Value
System.Drawing.Graphics
A Graphics object backed by a memory device context for measurement operations such as measuring text size or calculating drawing dimensions. |
Remarks
This Graphics object can be used for measurement operations without requiring a visible drawing surface. Do not dispose this Graphics object manually as it is managed by the MeasurementGraphics instance.
SyncObject
Gets the synchronization object used for thread-safe operations when working with measurement graphics.
Declaration
public static object SyncObject { get; }
Property Value
System.Object
A synchronization object that can be used for locking critical sections. |
Remarks
Use this object when you need to synchronize access to measurement graphics operations across multiple threads or when performing operations that require atomic access.
Methods
CreateMeasurementGraphics()
Creates a new instance of MeasurementGraphics for performing measurement operations.
Declaration
public static MeasurementGraphics CreateMeasurementGraphics()
Returns
MeasurementGraphics
A new MeasurementGraphics instance that provides access to a graphics context optimized for measurement operations. |
Remarks
Factory method for creating MeasurementGraphics instances. The returned instance should be disposed when no longer needed, preferably using a using statement.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Implements
Remarks
This implementation of Dispose does not actually release resources immediately. The underlying memory device context is managed through reference counting using the Telerik.WinControls.MeasurementGraphics.IncreaseControlCount and Telerik.WinControls.MeasurementGraphics.DecreaseControlCount methods.
The memory device context is automatically released when the last control on the current thread decreases the control count to zero.