<PackageReference Include="System.Drawing.Common" Version="11.0.0-preview.2.26159.112" />

Windows.Win32.Graphics.Gdi.GetDcScope

struct GetDcScope
Helper to scope lifetime of an HDC retrieved via GetDC and GetDCEx. Releases the HDC (if any) when disposed.
namespace Windows.Win32.Graphics.Gdi { internal readonly ref struct GetDcScope { public HDC HDC { get; } public HWND HWND { get; } public static GetDcScope ScreenDC { get; } public bool IsNull { get; } public GetDcScope(HWND hwnd); public GetDcScope(HWND hwnd, HRGN hrgnClip, GET_DCX_FLAGS flags); public static implicit operator IntPtr(ref GetDcScope scope); public static implicit operator HDC(ref GetDcScope scope); public void Dispose(); } }