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

Windows.Win32.Graphics.Gdi.CreatePenScope

Helper to scope the lifetime of a HPEN.
namespace Windows.Win32.Graphics.Gdi { internal readonly ref struct CreatePenScope { public HPEN HPEN { get; } public bool IsNull { get; } public CreatePenScope(Color color, int width = 1); public static implicit operator HPEN(ref CreatePenScope scope); public static implicit operator HGDIOBJ(ref CreatePenScope scope); public void Dispose(); } }