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

Windows.Win32.Graphics.Gdi.BeginPaintScope

Helper to scope lifetime of an HDC retrieved via BeginPaint
namespace Windows.Win32.Graphics.Gdi { internal readonly ref struct BeginPaintScope { public HDC HDC { get; } public HWND HWND { get; } public Rectangle PaintRectangle { get; } public BeginPaintScope(HWND hwnd); public static implicit operator HDC(ref BeginPaintScope scope); public void Dispose(); } }