104 references to HDC
System.Private.Windows.Core (81)
System\ArgumentValidation.cs (1)
47internal static void ThrowIfNull(HDC argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
System\Drawing\ApplyGraphicsProperties.cs (1)
9/// Enumeration defining the different Graphics properties to apply to an <see cref="HDC"/> when creating it
System\Drawing\IGraphicsContextInfo.cs (1)
10(HDC hdc, int saveState) GetHdc(ApplyGraphicsProperties apply, bool alwaysSaveState);
Windows\Win32\Foundation\WPARAM.cs (3)
16public static explicit operator HDC(WPARAM value) => (HDC)(nint)value.Value; 17public static explicit operator WPARAM(HDC value) => new((nuint)value.Value);
Windows\Win32\Graphics\Gdi\BeginPaintScope.cs (2)
25public HDC HDC { get; } 35public static implicit operator HDC(in BeginPaintScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\CreateBitmapScope.cs (3)
31/// Creates a bitmap compatible with the given <see cref="HDC"/> via 32/// <see cref="PInvokeCore.CreateCompatibleBitmap(HDC, int, int)"/> 34public CreateBitmapScope(HDC hdc, int cx, int cy) => HBITMAP = PInvokeCore.CreateCompatibleBitmap(hdc, cx, cy);
Windows\Win32\Graphics\Gdi\CreateDcScope.cs (4)
22public HDC HDC { get; } 25/// Creates a compatible HDC for <paramref name="hdc"/> using <see cref="PInvokeCore.CreateCompatibleDC(HDC)"/>. 32public CreateDcScope(HDC hdc) 52public static implicit operator HDC(in CreateDcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (4)
30public HDC HDC { get; } 39/// When a <see cref="T:System.Drawing.Graphics"/> object is created from a <see cref="Gdi.HDC"/> the clipping region and 40/// the viewport origin are applied (<see cref="PInvokeCore.GetViewportExtEx(HDC, SIZE*)"/>). The clipping 158public static implicit operator HDC(in DeviceContextHdcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\GetDcScope.cs (5)
7/// Helper to scope lifetime of an <see cref="Gdi.HDC"/> retrieved via <see cref="PInvokeCore.GetDC(HWND)"/> and 8/// <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. Releases the <see cref="Gdi.HDC"/> (if any) 19public HDC HDC { get; } 29/// Creates a <see cref="Gdi.HDC"/> using <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. 60public static implicit operator HDC(in GetDcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\HDC.cs (5)
6internal readonly partial struct HDC : IHandle<HDC> 8HDC IHandle<HDC>.Handle => this; 9object? IHandle<HDC>.Wrapper => null; 11public static HDC Null => default;
Windows\Win32\Graphics\Gdi\HdcHandle.cs (4)
7/// Used when you must keep a handle to an <see cref="HDC"/> in a field. Avoid keeping HDC handles in fields 10internal sealed class HdcHandle : IDisposable, IHandle<HDC> 24public HDC Handle { get; private set; } 26public static implicit operator HDC(in HdcHandle handle) => handle.Handle;
Windows\Win32\Graphics\Gdi\HGDIOBJ.cs (1)
8public static implicit operator HGDIOBJ(HDC value) => (HGDIOBJ)value.Value;
Windows\Win32\Graphics\Gdi\IGraphicsHdcProvider.cs (2)
27/// Gets the <see cref="HDC"/>, if the object was created from one. 29HDC GetHdc();
Windows\Win32\Graphics\Gdi\IHDCContext.cs (1)
8HDC GetHdc();
Windows\Win32\Graphics\Gdi\RegionScope.cs (2)
39/// Creates a clipping region copy via <see cref="PInvokeCore.GetClipRgn(HDC, HRGN)"/> for the given device context. 42public RegionScope(HDC hdc)
Windows\Win32\Graphics\Gdi\SaveDcScope.cs (3)
25public HDC HDC { get; } 29/// Saves the device context state using <see cref="PInvokeCore.SaveDC(HDC)"/>. 32public SaveDcScope(HDC hdc)
Windows\Win32\Graphics\Gdi\SelectObjectScope.cs (5)
7/// Helper to scope selecting a GDI object into an <see cref="HDC"/>. Restores the original 8/// object into the <see cref="HDC"/> when disposed. 22private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SelectObject(HDC, HGDIOBJ)"/>. 29public SelectObjectScope(HDC hdc, HGDIOBJ @object)
Windows\Win32\Graphics\Gdi\SelectPaletteScope.cs (3)
23public HDC HDC { get; } 28public SelectPaletteScope(HDC hdc, HPALETTE hpalette, bool forceBackground, bool realizePalette) 41public static SelectPaletteScope HalftonePalette(HDC hdc, bool forceBackground, bool realizePalette)
Windows\Win32\Graphics\Gdi\SetBackgroundColorScope.cs (3)
19private readonly HDC _hdc; 23/// <see cref="PInvokeCore.SetBkColor(HDC, COLORREF)"/>. 25public SetBackgroundColorScope(HDC hdc, COLORREF color)
Windows\Win32\Graphics\Gdi\SetBkModeScope.cs (2)
23private readonly HDC _hdc; 28public SetBkModeScope(HDC hdc, BACKGROUND_MODE bkmode)
Windows\Win32\Graphics\Gdi\SetMapModeScope.cs (3)
23private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SetMapMode(HDC, HDC_MAP_MODE)"/>. 29public SetMapModeScope(HDC hdc, HDC_MAP_MODE mapMode)
Windows\Win32\Graphics\Gdi\SetRop2Scope.cs (3)
23private readonly HDC _hdc; 26/// Selects <paramref name="rop2"/> into the given <paramref name="hdc"/> using <see cref="PInvokeCore.SetROP2(HDC, R2_MODE)"/>. 28public SetRop2Scope(HDC hdc, R2_MODE rop2)
Windows\Win32\Graphics\Gdi\SetTextAlignmentScope.cs (3)
23private readonly HDC _hdc; 27/// using <see cref="PInvokeCore.SetTextAlign(HDC, TEXT_ALIGN_OPTIONS)"/>. 29public SetTextAlignmentScope(HDC hdc, TEXT_ALIGN_OPTIONS ta)
Windows\Win32\Graphics\Gdi\SetTextColorScope.cs (3)
23private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SetTextColor(HDC, COLORREF)"/>. 29public SetTextColorScope(HDC hdc, COLORREF color)
Windows\Win32\PInvokeCore.BitBlt.cs (8)
8/// <inheritdoc cref="BitBlt(HDC, int, int, int, int, HDC, int, int, ROP_CODE)"/> 15HDC hdcSrc, 18ROP_CODE rop) where T : IHandle<HDC> 34/// <inheritdoc cref="BitBlt(HDC, int, int, int, int, HDC, int, int, ROP_CODE)"/> 36HDC hdc, 44ROP_CODE rop) where T : IHandle<HDC>
Windows\Win32\PInvokeCore.DrawIcon.cs (1)
8public static BOOL DrawIcon<T>(HDC hDC, int x, int y, T hIcon)
Windows\Win32\PInvokeCore.DrawIconEx.cs (2)
8/// <inheritdoc cref="DrawIconEx(HDC, int, int, HICON, int, int, uint, HBRUSH, DI_FLAGS)"/>/> 10HDC hDC,
Windows\Win32\PInvokeCore.EnumDisplayMonitors.cs (2)
11public delegate bool EnumDisplayMonitorsCallback(HMONITOR monitor, HDC hdc); 27private static BOOL EnumDisplayMonitorsNativeCallback(HMONITOR monitor, HDC hdc, RECT* lprcMonitor, LPARAM lParam)
Windows\Win32\UI\Controls\Dialogs\PRINTDLGEXW.cs (1)
117public HDC hDC;
System.Windows.Forms (13)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
406/// <inheritdoc cref="IViewObject.Interface.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/>
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (6)
513/// <inheritdoc cref="IViewObject.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/> 543/// <inheritdoc cref="IViewObject.GetColorSet(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, LOGPALETTE**)"/> 569/// <inheritdoc cref="IViewObject.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/> 593/// <inheritdoc cref="IViewObject.GetColorSet(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, LOGPALETTE**)"/>
System\Windows\Forms\Rendering\DrawingEventFlags.cs (1)
24/// default when constructing via an <see cref="HDC"/> as it, by definition, has no <see cref="Graphics"/>
System\Windows\Forms\Rendering\GdiCache.cs (3)
19/// Gets an <see cref="HDC"/> based off of the primary display. 26/// When disposed the <see cref="HDC"/> will be returned to the cache. Do NOT change the state of the 43/// When disposed the <see cref="Graphics"/> object will be disposed and the underlying <see cref="HDC"/>
System\Windows\Forms\Rendering\TextRenderer.cs (1)
656/// The <see cref="HDC"/> to get the font from if <paramref name="font"/> is <see langword="null"/>.
System.Windows.Forms.Primitives (8)
System\Windows\Forms\DeviceContextExtensions.cs (1)
101/// Calls <see cref="PInvoke.GetNearestColor(HDC, COLORREF)"/> to get the nearest color for the given
Windows\Win32\PInvoke.DrawTextEx.cs (1)
8/// <inheritdoc cref="DrawTextEx(HDC, PWSTR, int, RECT*, DRAW_TEXT_FORMAT, DRAWTEXTPARAMS*)"/>
Windows\Win32\PInvoke.FillRect.cs (1)
8/// <inheritdoc cref="FillRect(HDC, in RECT, HBRUSH)"/>
Windows\Win32\PInvoke.GetTextExtentPoint32.cs (1)
10/// <inheritdoc cref="GetTextExtentPoint32W(HDC, PCWSTR, int, SIZE*)"/>
Windows\Win32\PInvoke.GetThemeFont.cs (1)
10/// <inheritdoc cref="GetThemeFont(HTHEME, HDC, int, int, int, LOGFONTW*)"/>
Windows\Win32\PInvoke.ImageList.cs (2)
28/// <inheritdoc cref="ImageList_Draw(HIMAGELIST, int, HDC, int, int, IMAGE_LIST_DRAW_STYLE)"/> 37/// <inheritdoc cref="ImageList_DrawEx(HIMAGELIST, int, HDC, int, int, int, int, COLORREF, COLORREF, IMAGE_LIST_DRAW_STYLE)"/>
Windows\Win32\PInvoke.IntersectClipRect.cs (1)
8/// <inheritdoc cref="IntersectClipRect(HDC, int, int, int, int)"/>
System.Windows.Forms.Primitives.TestUtilities (1)
HdcDeviceContextAdapter.cs (1)
9/// Simple adapter for passing <see cref="HDC"/> as <see cref="IDeviceContext"/>. Does not manage HDC
System.Windows.Forms.Tests (1)
System\Windows\Forms\AxHostTests.cs (1)
1706iPicture.get_CurDC(out HDC _).Should().Be(HRESULT.E_FAIL);