ClassMeasurementGraphics
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.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class MeasurementGraphics : IDisposable
Inheritance: objectMeasurementGraphics
Implements:
Properties
Graphics
Gets the Graphics object associated with this measurement graphics context.
Declaration
public Graphics Graphics { get; }
Property Value
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
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
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 and methods.
The memory device context is automatically released when the last control on the current thread decreases the control count to zero.