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

Windows.Win32.Graphics.Gdi.HdcHandle

sealed class HdcHandle : IDisposable, IHandle<HDC>
Used when you must keep a handle to an HDC in a field. Avoid keeping HDC handles in fields when possible.
namespace Windows.Win32.Graphics.Gdi { internal sealed class HdcHandle : IDisposable, IHandle<HDC> { public HDC Handle { get; } public HdcHandle(CreateDcScope hdc); public static implicit operator HDC(ref HdcHandle handle); public static implicit operator IntPtr(ref HdcHandle handle); public void Dispose(); } }