New to Telerik UI for WinFormsStart a free 30-day trial

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:

C#
public class MeasurementGraphics : IDisposable

Inheritance: objectMeasurementGraphics

Implements: IDisposable

Properties

Gets the Graphics object associated with this measurement graphics context.

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

Gets the synchronization object used for thread-safe operations when working with measurement graphics.

C#
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

Creates a new instance of MeasurementGraphics for performing measurement operations.

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

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

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