<PackageReference Include="System.Drawing.Common" Version="9.0.9" />

DeviceContextHdcScope

Helper to scope getting a HDC from a IHdcContext object. Releases the HDC when disposed, unlocking the parent IHdcContext object.

Also saves and restores the state of the HDC.

public IHdcContext DeviceContext { get; }

public HDC HDC { get; }

public DeviceContextHdcScope(IHdcContext deviceContext, bool applyGraphicsState = true, bool saveHdcState = false)

Gets the HDC from the given deviceContext.

public DeviceContextHdcScope(IHdcContext deviceContext, ApplyGraphicsProperties applyGraphicsState, bool saveHdcState = false)

Prefer to use #ctor.

public static WPARAM op_Explicit(ref DeviceContextHdcScope scope)

public static HDC op_Implicit(ref DeviceContextHdcScope scope)

public static IntPtr op_Implicit(ref DeviceContextHdcScope scope)

public void Dispose()