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.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class MeasurementGraphics : IDisposable

Inheritance: objectMeasurementGraphics

Implements: IDisposable

Properties

Graphics

Gets the Graphics object associated with this measurement graphics context.

Declaration

cs-api-definition
public Graphics Graphics { get; }

Property Value

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

cs-api-definition
public static object SyncObject { get; }

Property Value

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

cs-api-definition
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

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

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.