4 instantiations of HBITMAP
System.Private.Windows.Core (4)
Windows.Win32.HBITMAP.g.cs (3)
41 public static explicit operator HBITMAP(void* value) => new HBITMAP(value); 57 public static explicit operator HBITMAP(IntPtr value) => new HBITMAP((void*)value.ToPointer()); 59 public static explicit operator HBITMAP(UIntPtr value) => new HBITMAP((void*)value.ToPointer());
Windows\Win32\System\Ole\OLE_HANDLE.cs (1)
11public static explicit operator HBITMAP(OLE_HANDLE handle) => new((int)handle.Value);
168 references to HBITMAP
PresentationCore (13)
MS\Internal\SystemDrawingHelper.cs (9)
40internal static HBITMAP GetHBitmap(object? data, out int width, out int height) 45return (HBITMAP)extensions.GetHBitmap(data, out width, out height); 49return HBITMAP.Null; 53internal static HBITMAP GetHBitmapFromBitmap(object? data) => 54(HBITMAP)(AssemblyHelper.ExtensionsForSystemDrawing()?.GetHBitmapFromBitmap(data) ?? HBITMAP.Null); 57internal static HBITMAP ConvertMetafileToHBitmap(HENHMETAFILE handle) => 58(HBITMAP)(AssemblyHelper.ExtensionsForSystemDrawing(force: true)?.ConvertMetafileToHBitmap(handle) ?? HBITMAP.Null);
System\Windows\Ole\WpfOleServices.cs (4)
62static HBITMAP GetCompatibleBitmap(object data) 64HBITMAP hbitmap = SystemDrawingHelper.GetHBitmap(data, out int width, out int height); 66return hbitmap.IsNull ? HBITMAP.Null : hbitmap.CreateCompatibleBitmap(width, height); 123(HBITMAP)(nint)medium.hGlobal,
System.Drawing.Common (12)
System\Drawing\Bitmap.cs (2)
156HBITMAP IBitmap.GetHbitmap() => (HBITMAP)GetHbitmap();
System\Drawing\BufferedGraphicsContext.cs (8)
20private HBITMAP _dib; 21private HBITMAP _oldBitmap; 327_oldBitmap = (HBITMAP)PInvokeCore.SelectObject(_compatDC, _dib); 352private HBITMAP CreateCompatibleDIB(HDC hdc, HPALETTE hpalette, int ulWidth, int ulHeight) 359HBITMAP hbitmap = HBITMAP.Null; 427_oldBitmap = HBITMAP.Null; 449_dib = HBITMAP.Null;
System\Drawing\Image.cs (1)
782PInvokeGdiPlus.GdipCreateBitmapFromHBITMAP((HBITMAP)hbitmap, (HPALETTE)hpalette, &bitmap).ThrowIfFailed();
Windows.Win32.PInvoke.GDI32.dll.g.cs (1)
127 internal static extern unsafe int GetDIBits(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.HBITMAP hbm, uint start, uint cLines, [Optional] void* lpvBits, winmdroot.Graphics.Gdi.BITMAPINFO* lpbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage);
System.Private.Windows.Core (60)
System\Private\Windows\Graphics\IBitmap.cs (1)
16HBITMAP GetHbitmap();
System\Private\Windows\Ole\DragDropHelper.cs (2)
269using HBITMAP hbmpDragImage = dragImage is not null ? dragImage.GetHbitmap() : HBITMAP.Null;
Windows.Win32.HBITMAP.g.cs (36)
25 : IEquatable<HBITMAP> 35 internal static HBITMAP Null => default; 39 public static implicit operator void*(HBITMAP value) => value.Value; 41 public static explicit operator HBITMAP(void* value) => new HBITMAP(value); 43 public static bool operator ==(HBITMAP left, HBITMAP right) => left.Value == right.Value; 45 public static bool operator !=(HBITMAP left, HBITMAP right) => !(left == right); 47 public bool Equals(HBITMAP other) => this.Value == other.Value; 49 public override bool Equals(object obj) => obj is HBITMAP other && this.Equals(other); 55 public static implicit operator IntPtr(HBITMAP value) => new IntPtr(value.Value); 57 public static explicit operator HBITMAP(IntPtr value) => new HBITMAP((void*)value.ToPointer()); 59 public static explicit operator HBITMAP(UIntPtr value) => new HBITMAP((void*)value.ToPointer()); 61 public static implicit operator HGDIOBJ(HBITMAP value) => new HGDIOBJ(value.Value); 63 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_CALLBACK = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(-1); 65 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_SYSTEM = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(1); 67 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_MBAR_RESTORE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(2); 69 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_MBAR_MINIMIZE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(3); 71 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_MBAR_CLOSE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(5); 73 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_MBAR_CLOSE_D = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(6); 75 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_MBAR_MINIMIZE_D = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(7); 77 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_POPUP_CLOSE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(8); 79 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_POPUP_RESTORE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(9); 81 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_POPUP_MAXIMIZE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(10); 83 internal static readonly winmdroot.Graphics.Gdi.HBITMAP HBMMENU_POPUP_MINIMIZE = (winmdroot.Graphics.Gdi.HBITMAP)(IntPtr)(11);
Windows.Win32.ICONINFO.g.cs (2)
52 internal winmdroot.Graphics.Gdi.HBITMAP hbmMask; 58 internal winmdroot.Graphics.Gdi.HBITMAP hbmColor;
Windows.Win32.PICTDESC.g.cs (1)
61 internal winmdroot.Graphics.Gdi.HBITMAP hbitmap;
Windows.Win32.PInvokeCore.GDI32.dll.g.cs (7)
130 internal static extern unsafe winmdroot.Graphics.Gdi.HBITMAP CreateBitmap(int nWidth, int nHeight, uint nPlanes, uint nBitCount, [Optional] void* lpBits); 147 internal static extern winmdroot.Graphics.Gdi.HBITMAP CreateCompatibleBitmap(winmdroot.Graphics.Gdi.HDC hdc, int cx, int cy); 204 internal static unsafe winmdroot.Graphics.Gdi.HBITMAP CreateDIBSection(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.BITMAPINFO* pbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage, out void* ppvBits, winmdroot.Foundation.HANDLE hSection, uint offset) 208 winmdroot.Graphics.Gdi.HBITMAP __result = PInvokeCore.CreateDIBSection(hdc, pbmi, usage, ppvBitsLocal, hSection, offset); 236 internal static unsafe winmdroot.Graphics.Gdi.HBITMAP CreateDIBSection(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.BITMAPINFO* pbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage, void** ppvBits, winmdroot.Foundation.HANDLE hSection, uint offset) 239 winmdroot.Graphics.Gdi.HBITMAP __retVal = LocalExternFunction(hdc, pbmi, usage, ppvBits, hSection, offset); 244 static extern unsafe winmdroot.Graphics.Gdi.HBITMAP LocalExternFunction(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.BITMAPINFO* pbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage, void** ppvBits, winmdroot.Foundation.HANDLE hSection, uint offset);
Windows.Win32.SHDRAGIMAGE.g.cs (1)
47 internal winmdroot.Graphics.Gdi.HBITMAP hbmpDragImage;
Windows.Win32.STGMEDIUM.g.cs (1)
42 internal winmdroot.Graphics.Gdi.HBITMAP hBitmap;
Windows\Win32\Graphics\Gdi\CreateBitmapScope.cs (4)
7/// Helper to scope lifetime of a <see cref="Gdi.HBITMAP"/> created via <see cref="PInvokeCore.CreateBitmap"/> 8/// Deletes the <see cref="Gdi.HBITMAP"/> (if any) when disposed. 22public HBITMAP HBITMAP { get; } 36public static implicit operator HBITMAP(in CreateBitmapScope scope) => scope.HBITMAP;
Windows\Win32\Graphics\Gdi\HBITMAP.cs (2)
19public HBITMAP CreateCompatibleBitmap(int width, int height) 29HBITMAP compatibleBitmap = PInvokeCore.CreateCompatibleBitmap(screenDC, width, height);
Windows\Win32\Graphics\Gdi\HGDIOBJ.cs (2)
12public static explicit operator HBITMAP(HGDIOBJ value) => (HBITMAP)value.Value;
Windows\Win32\System\Ole\OLE_HANDLE.cs (1)
11public static explicit operator HBITMAP(OLE_HANDLE handle) => new((int)handle.Value);
System.Private.Windows.GdiPlus (10)
Windows.Win32.PInvokeGdiPlus.gdiplus.dll.g.cs (7)
895 /// <inheritdoc cref="GdipCreateBitmapFromHBITMAP(winmdroot.Graphics.Gdi.HBITMAP, winmdroot.Graphics.Gdi.HPALETTE, winmdroot.Graphics.GdiPlus.GpBitmap**)"/> 896 internal static unsafe winmdroot.Graphics.GdiPlus.Status GdipCreateBitmapFromHBITMAP(winmdroot.Graphics.Gdi.HBITMAP hbm, winmdroot.Graphics.Gdi.HPALETTE hpal, ref winmdroot.Graphics.GdiPlus.GpBitmap* bitmap) 906 internal static extern unsafe winmdroot.Graphics.GdiPlus.Status GdipCreateBitmapFromHBITMAP(winmdroot.Graphics.Gdi.HBITMAP hbm, winmdroot.Graphics.Gdi.HPALETTE hpal, winmdroot.Graphics.GdiPlus.GpBitmap** bitmap); 1147 /// <inheritdoc cref="GdipCreateHBITMAPFromBitmap(winmdroot.Graphics.GdiPlus.GpBitmap*, winmdroot.Graphics.Gdi.HBITMAP*, uint)"/> 1148 internal static unsafe winmdroot.Graphics.GdiPlus.Status GdipCreateHBITMAPFromBitmap(ref winmdroot.Graphics.GdiPlus.GpBitmap bitmap, ref winmdroot.Graphics.Gdi.HBITMAP hbmReturn, uint background) 1150 fixed (winmdroot.Graphics.Gdi.HBITMAP* hbmReturnLocal = &hbmReturn) 1161 internal static extern unsafe winmdroot.Graphics.GdiPlus.Status GdipCreateHBITMAPFromBitmap(winmdroot.Graphics.GdiPlus.GpBitmap* bitmap, winmdroot.Graphics.Gdi.HBITMAP* hbmReturn, uint background);
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (3)
37public static HBITMAP GetHBITMAP(this IPointer<GpBitmap> bitmap) => bitmap.GetHBITMAP(DrawingColor.LightGray); 39public static HBITMAP GetHBITMAP(this IPointer<GpBitmap> bitmap, DrawingColor background) 41HBITMAP hbitmap;
System.Windows.Forms (32)
System\Windows\Forms\Control.MetafileDCWrapper.cs (6)
23private HBITMAP _hBitmap; 24private HBITMAP _hOriginalBmp; 45_hOriginalBmp = (HBITMAP)PInvokeCore.SelectObject(HDC, _hBitmap); 91HBITMAP hNullBitmap = PInvokeCore.CreateBitmap(1, 1, 1, 1, null); 99HBITMAP hBitmap = (HBITMAP)PInvokeCore.SelectObject(hdcSrc, hNullBitmap);
System\Windows\Forms\Controls\ImageList\ImageList.cs (4)
374HBITMAP hMask = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap); 377HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapColorMask(bitmap, (IntPtr)hMask);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (4)
158HBITMAP hMask = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap); 159HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapColorMask(bitmap, hMask);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1706using HBITMAP compatibleBitmap = PInvokeCore.CreateBitmap(rectangle.Width, rectangle.Height, (uint)planes, (uint)bitsPixel, lpBits: null);
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (1)
16private HBITMAP _cachedItemBitmap;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (10)
672if (!info.hbmpItem.IsNull && (int)info.hbmpItem > (int)HBITMAP.HBMMENU_POPUP_MINIMIZE) 680if (info.hbmpItem == HBITMAP.HBMMENU_MBAR_CLOSE 681|| info.hbmpItem == HBITMAP.HBMMENU_MBAR_CLOSE_D 682|| info.hbmpItem == HBITMAP.HBMMENU_POPUP_CLOSE) 686else if (info.hbmpItem == HBITMAP.HBMMENU_MBAR_MINIMIZE 687|| info.hbmpItem == HBITMAP.HBMMENU_MBAR_MINIMIZE_D 688|| info.hbmpItem == HBITMAP.HBMMENU_POPUP_MINIMIZE) 692else if (info.hbmpItem == HBITMAP.HBMMENU_MBAR_RESTORE 693|| info.hbmpItem == HBITMAP.HBMMENU_POPUP_RESTORE) 697else if (info.hbmpItem == HBITMAP.HBMMENU_POPUP_MAXIMIZE)
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (1)
69HBITMAP hbitmapTemp = PInvokeCore.CreateBitmap(8, 8, 1, 1, patternBits);
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (2)
44using HBITMAP mask = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap);
System\Windows\Forms\Rendering\ControlPaint.cs (3)
177HBITMAP hbitmap; 334HBITMAP colorMask = (HBITMAP)bitmap.GetHbitmap();
System.Windows.Forms.Primitives (25)
System\Drawing\ImageExtensions.cs (1)
47return Image.FromHbitmap((HBITMAP)handle, (HPALETTE)paletteHandle);
System\Windows\Forms\SystemDrawingExtensions.cs (2)
13internal static HBITMAP GetHBITMAP(this Bitmap bitmap) => (HBITMAP)bitmap.GetHbitmap();
Windows.Win32.HDITEMW.g.cs (1)
50 internal winmdroot.Graphics.Gdi.HBITMAP hbm;
Windows.Win32.IMAGEINFO.g.cs (2)
33 internal winmdroot.Graphics.Gdi.HBITMAP hbmImage; 39 internal winmdroot.Graphics.Gdi.HBITMAP hbmMask;
Windows.Win32.LVBKIMAGEW.g.cs (1)
42 internal winmdroot.Graphics.Gdi.HBITMAP hbm;
Windows.Win32.MENUITEMINFOW.g.cs (3)
66 internal winmdroot.Graphics.Gdi.HBITMAP hbmpChecked; 72 internal winmdroot.Graphics.Gdi.HBITMAP hbmpUnchecked; 97 internal winmdroot.Graphics.Gdi.HBITMAP hbmpItem;
Windows.Win32.PInvoke.COMCTL32.dll.g.cs (4)
63 internal static extern int ImageList_Add(winmdroot.UI.Controls.HIMAGELIST himl, winmdroot.Graphics.Gdi.HBITMAP hbmImage, winmdroot.Graphics.Gdi.HBITMAP hbmMask); 307 internal static extern winmdroot.Foundation.BOOL ImageList_Replace(winmdroot.UI.Controls.HIMAGELIST himl, int i, winmdroot.Graphics.Gdi.HBITMAP hbmImage, winmdroot.Graphics.Gdi.HBITMAP hbmMask);
Windows.Win32.PInvoke.GDI32.dll.g.cs (3)
74 internal static extern winmdroot.Graphics.Gdi.HBRUSH CreatePatternBrush(winmdroot.Graphics.Gdi.HBITMAP hbm); 155 internal static extern unsafe int GetBitmapBits(winmdroot.Graphics.Gdi.HBITMAP hbit, int cb, void* lpvBits); 285 internal static extern unsafe int GetDIBits(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.HBITMAP hbm, uint start, uint cLines, [Optional] void* lpvBits, winmdroot.Graphics.Gdi.BITMAPINFO* lpbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage);
Windows\Win32\PInvoke.ImageList.cs (8)
12/// <inheritdoc cref="ImageList_Add(HIMAGELIST, HBITMAP, HBITMAP)"/> 13public static int Add<T>(T himl, HBITMAP hbmImage, HBITMAP hbmMask) where T : IHandle<HIMAGELIST> 92/// <inheritdoc cref="ImageList_Replace(HIMAGELIST, int, HBITMAP, HBITMAP)"/> 93public static bool Replace<T>(T himl, int i, HBITMAP hbmImage, HBITMAP hbmMask) where T : IHandle<HIMAGELIST>
System.Windows.Forms.Tests (16)
System\Windows\Forms\ControlPaintTests.cs (16)
36HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmap16Bit(bitmap, background); 61HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmap16Bit(bitmap, Color.Red); 107HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapColorMask(bitmap, monochromeMask); 131HBITMAP monochromeMask = (HBITMAP)mask.GetHbitmap(); 139HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapColorMask(bitmap, (IntPtr)monochromeMask); 172HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapColorMask(bitmap, IntPtr.Zero); 215HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap); 240HBITMAP hBitmap = (HBITMAP)ControlPaint.CreateHBitmapTransparencyMask(bitmap);