87 references to HBITMAP
PresentationCore (13)
MS\Internal\SystemDrawingHelper.cs (9)
40
internal static
HBITMAP
GetHBitmap(object? data, out int width, out int height)
45
return (
HBITMAP
)extensions.GetHBitmap(data, out width, out height);
49
return
HBITMAP
.Null;
53
internal static
HBITMAP
GetHBitmapFromBitmap(object? data) =>
54
(
HBITMAP
)(AssemblyHelper.ExtensionsForSystemDrawing()?.GetHBitmapFromBitmap(data) ??
HBITMAP
.Null);
57
internal static
HBITMAP
ConvertMetafileToHBitmap(HENHMETAFILE handle) =>
58
(
HBITMAP
)(AssemblyHelper.ExtensionsForSystemDrawing(force: true)?.ConvertMetafileToHBitmap(handle) ??
HBITMAP
.Null);
System\Windows\Ole\WpfOleServices.cs (4)
62
static
HBITMAP
GetCompatibleBitmap(object data)
64
HBITMAP
hbitmap = SystemDrawingHelper.GetHBitmap(data, out int width, out int height);
66
return hbitmap.IsNull ?
HBITMAP
.Null : hbitmap.CreateCompatibleBitmap(width, height);
123
(
HBITMAP
)(nint)medium.hGlobal,
System.Private.Windows.Core (12)
System\Private\Windows\Graphics\IBitmap.cs (1)
16
HBITMAP
GetHbitmap();
System\Private\Windows\Ole\DragDropHelper.cs (2)
269
using
HBITMAP
hbmpDragImage = dragImage is not null ? dragImage.GetHbitmap() :
HBITMAP
.Null;
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.
22
public
HBITMAP
HBITMAP { get; }
36
public static implicit operator
HBITMAP
(in CreateBitmapScope scope) => scope.HBITMAP;
Windows\Win32\Graphics\Gdi\HBITMAP.cs (2)
19
public
HBITMAP
CreateCompatibleBitmap(int width, int height)
29
HBITMAP
compatibleBitmap = PInvokeCore.CreateCompatibleBitmap(screenDC, width, height);
Windows\Win32\Graphics\Gdi\HGDIOBJ.cs (2)
12
public static explicit operator
HBITMAP
(HGDIOBJ value) => (
HBITMAP
)value.Value;
Windows\Win32\System\Ole\OLE_HANDLE.cs (1)
11
public static explicit operator
HBITMAP
(OLE_HANDLE handle) => new((int)handle.Value);
System.Private.Windows.GdiPlus (3)
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (3)
37
public static
HBITMAP
GetHBITMAP(this IPointer<GpBitmap> bitmap) => bitmap.GetHBITMAP(DrawingColor.LightGray);
39
public static
HBITMAP
GetHBITMAP(this IPointer<GpBitmap> bitmap, DrawingColor background)
41
HBITMAP
hbitmap;
System.Windows.Forms (32)
System\Windows\Forms\Control.MetafileDCWrapper.cs (6)
23
private
HBITMAP
_hBitmap;
24
private
HBITMAP
_hOriginalBmp;
45
_hOriginalBmp = (
HBITMAP
)PInvokeCore.SelectObject(HDC, _hBitmap);
91
HBITMAP
hNullBitmap = PInvokeCore.CreateBitmap(1, 1, 1, 1, null);
99
HBITMAP
hBitmap = (
HBITMAP
)PInvokeCore.SelectObject(hdcSrc, hNullBitmap);
System\Windows\Forms\Controls\ImageList\ImageList.cs (4)
374
HBITMAP
hMask = (
HBITMAP
)ControlPaint.CreateHBitmapTransparencyMask(bitmap);
377
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapColorMask(bitmap, (IntPtr)hMask);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (4)
158
HBITMAP
hMask = (
HBITMAP
)ControlPaint.CreateHBitmapTransparencyMask(bitmap);
159
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapColorMask(bitmap, hMask);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1709
using
HBITMAP
compatibleBitmap = PInvokeCore.CreateBitmap(rectangle.Width, rectangle.Height, (uint)planes, (uint)bitsPixel, lpBits: null);
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (1)
16
private
HBITMAP
_cachedItemBitmap;
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (10)
672
if (!info.hbmpItem.IsNull && (int)info.hbmpItem > (int)
HBITMAP
.HBMMENU_POPUP_MINIMIZE)
680
if (info.hbmpItem ==
HBITMAP
.HBMMENU_MBAR_CLOSE
681
|| info.hbmpItem ==
HBITMAP
.HBMMENU_MBAR_CLOSE_D
682
|| info.hbmpItem ==
HBITMAP
.HBMMENU_POPUP_CLOSE)
686
else if (info.hbmpItem ==
HBITMAP
.HBMMENU_MBAR_MINIMIZE
687
|| info.hbmpItem ==
HBITMAP
.HBMMENU_MBAR_MINIMIZE_D
688
|| info.hbmpItem ==
HBITMAP
.HBMMENU_POPUP_MINIMIZE)
692
else if (info.hbmpItem ==
HBITMAP
.HBMMENU_MBAR_RESTORE
693
|| info.hbmpItem ==
HBITMAP
.HBMMENU_POPUP_RESTORE)
697
else if (info.hbmpItem ==
HBITMAP
.HBMMENU_POPUP_MAXIMIZE)
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (1)
69
HBITMAP
hbitmapTemp = PInvokeCore.CreateBitmap(8, 8, 1, 1, patternBits);
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (2)
44
using
HBITMAP
mask = (
HBITMAP
)ControlPaint.CreateHBitmapTransparencyMask(bitmap);
System\Windows\Forms\Rendering\ControlPaint.cs (3)
149
HBITMAP
hbitmap;
306
HBITMAP
colorMask = (
HBITMAP
)bitmap.GetHbitmap();
System.Windows.Forms.Primitives (11)
System\Drawing\ImageExtensions.cs (1)
47
return Image.FromHbitmap((
HBITMAP
)handle, (HPALETTE)paletteHandle);
System\Windows\Forms\SystemDrawingExtensions.cs (2)
13
internal static
HBITMAP
GetHBITMAP(this Bitmap bitmap) => (
HBITMAP
)bitmap.GetHbitmap();
Windows\Win32\PInvoke.ImageList.cs (8)
12
/// <inheritdoc cref="ImageList_Add(HIMAGELIST,
HBITMAP
,
HBITMAP
)"/>
13
public static int Add<T>(T himl,
HBITMAP
hbmImage,
HBITMAP
hbmMask) where T : IHandle<HIMAGELIST>
92
/// <inheritdoc cref="ImageList_Replace(HIMAGELIST, int,
HBITMAP
,
HBITMAP
)"/>
93
public 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)
36
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmap16Bit(bitmap, background);
61
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmap16Bit(bitmap, Color.Red);
107
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapColorMask(bitmap, monochromeMask);
131
HBITMAP
monochromeMask = (
HBITMAP
)mask.GetHbitmap();
139
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapColorMask(bitmap, (IntPtr)monochromeMask);
172
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapColorMask(bitmap, IntPtr.Zero);
215
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapTransparencyMask(bitmap);
240
HBITMAP
hBitmap = (
HBITMAP
)ControlPaint.CreateHBitmapTransparencyMask(bitmap);