<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.1.25080.3" />

HBITMAP

using System; using System.CodeDom.Compiler; using System.Diagnostics; using System.Runtime.CompilerServices; namespace Windows.Win32.Graphics.Gdi { [DebuggerDisplay("{Value}")] [GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")] internal readonly struct HBITMAP : IDisposable, IEquatable<HBITMAP> { internal unsafe readonly void* Value; internal static readonly HBITMAP HBMMENU_CALLBACK = (HBITMAP)(IntPtr)(-1); internal static readonly HBITMAP HBMMENU_SYSTEM = (HBITMAP)(IntPtr)1; internal static readonly HBITMAP HBMMENU_MBAR_RESTORE = (HBITMAP)(IntPtr)2; internal static readonly HBITMAP HBMMENU_MBAR_MINIMIZE = (HBITMAP)(IntPtr)3; internal static readonly HBITMAP HBMMENU_MBAR_CLOSE = (HBITMAP)(IntPtr)5; internal static readonly HBITMAP HBMMENU_MBAR_CLOSE_D = (HBITMAP)(IntPtr)6; internal static readonly HBITMAP HBMMENU_MBAR_MINIMIZE_D = (HBITMAP)(IntPtr)7; internal static readonly HBITMAP HBMMENU_POPUP_CLOSE = (HBITMAP)(IntPtr)8; internal static readonly HBITMAP HBMMENU_POPUP_RESTORE = (HBITMAP)(IntPtr)9; internal static readonly HBITMAP HBMMENU_POPUP_MAXIMIZE = (HBITMAP)(IntPtr)10; internal static readonly HBITMAP HBMMENU_POPUP_MINIMIZE = (HBITMAP)(IntPtr)11; internal static HBITMAP Null => default(HBITMAP); internal unsafe bool IsNull => Value == null; public void Dispose() { if (!IsNull) PInvokeCore.DeleteObject(this); } internal unsafe HBITMAP(void* value) { Value = value; } internal unsafe HBITMAP(IntPtr value) { this = new HBITMAP((void*)(long)value); } public unsafe static implicit operator void*(HBITMAP value) { return value.Value; } public unsafe static explicit operator HBITMAP(void* value) { return new HBITMAP(value); } public unsafe static bool operator ==(HBITMAP left, HBITMAP right) { return left.Value == right.Value; } public static bool operator !=(HBITMAP left, HBITMAP right) { return !(left == right); } public unsafe bool Equals(HBITMAP other) { return Value == other.Value; } public override bool Equals(object obj) { if (obj is HBITMAP) { HBITMAP other = (HBITMAP)obj; return Equals(other); } return false; } public unsafe override int GetHashCode() { return (int)Value; } public unsafe override string ToString() { DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1); defaultInterpolatedStringHandler.AppendLiteral("0x"); defaultInterpolatedStringHandler.AppendFormatted((UIntPtr)Value, "x"); return defaultInterpolatedStringHandler.ToStringAndClear(); } public unsafe static implicit operator IntPtr(HBITMAP value) { return new IntPtr(value.Value); } public unsafe static explicit operator HBITMAP(IntPtr value) { return new HBITMAP(value.ToPointer()); } public unsafe static explicit operator HBITMAP(UIntPtr value) { return new HBITMAP(value.ToPointer()); } public unsafe static implicit operator HGDIOBJ(HBITMAP value) { return new HGDIOBJ(value.Value); } } }