4 writes to HDC
System.Private.Windows.GdiPlus (4)
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (4)
94
HDC
= default;
130
HDC
= needToApplyProperties ? default : provider.GetHdc();
146
HDC
= HDC.IsNull ? DeviceContext.GetHdc() : HDC;
155
(
HDC
, _savedHdcState) = graphics.GetHdc(applyGraphicsState, saveHdcState);
34 references to HDC
System.Private.Windows.GdiPlus (14)
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (14)
10
/// Helper to scope getting a <see cref="
HDC
"/> from a <see cref="IHdcContext"/> object. Releases
11
/// the <see cref="
HDC
"/> when disposed, unlocking the parent <see cref="IHdcContext"/> object.
35
/// Gets the <see cref="
HDC
"/> from the given <paramref name="deviceContext"/>.
53
/// When true, saves and restores the <see cref="
HDC
"/> state.
132
if (
HDC
.IsNull)
146
HDC =
HDC
.IsNull ? DeviceContext.GetHdc() :
HDC
;
148
_savedHdcState = saveHdcState ? PInvokeCore.SaveDC(
HDC
) : 0;
158
public static implicit operator HDC(in DeviceContextHdcScope scope) => scope.
HDC
;
159
public static implicit operator nint(in DeviceContextHdcScope scope) => scope.
HDC
;
160
public static explicit operator WPARAM(in DeviceContextHdcScope scope) => (WPARAM)scope.
HDC
;
165
if (
HDC
.IsNull)
174
OBJ_TYPE type = (OBJ_TYPE)PInvokeCore.GetObjectType(
HDC
);
194
PInvokeCore.RestoreDC(
HDC
, _savedHdcState);
System.Windows.Forms (4)
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (2)
515
textSize = hdc.
HDC
.MeasureText(Text, hfont, new Size(textRectangle.Width, int.MaxValue), (TextFormatFlags)flags);
519
hdc.
HDC
.DrawText(Text, hfont, textRectangle, ForeColor, (TextFormatFlags)flags);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
1132
foreColor = scope.
HDC
.FindNearestColor(DisabledColor);
System\Windows\Forms\Rendering\TextRenderer.cs (1)
545
return hdc.
HDC
.MeasureText(text, hfont, proposedSize, flags);
System.Windows.Forms.Primitives (8)
System\Windows\Forms\DeviceContextExtensions.cs (8)
14
DrawRectangle(hdc.
HDC
, rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom, hpen);
23
DrawRectangle(hdc.
HDC
, left, top, right, bottom, hpen);
41
FillRectangle(hdc.
HDC
, rectangle, hbrush);
54
DrawLine(hdc.
HDC
, hpen, p1.X, p1.Y, p2.X, p2.Y);
60
DrawLine(hdc.
HDC
, hpen, x1, y1, x2, y2);
72
DrawLines(hdc.
HDC
, hpen, lines);
98
internal static Color FindNearestColor(this DeviceContextHdcScope hdc, Color color) => FindNearestColor(hdc.
HDC
, color);
132
DrawAndFillEllipse(hdc.
HDC
, pen, brush, bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
System.Windows.Forms.Primitives.Tests (8)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (8)
125
Assert.Equal(hdc, scope.
HDC
);
149
Assert.Equal(hdc, scope.
HDC
);
172
Assert.Equal(hdc, scope.
HDC
);
195
Assert.Equal(hdc, scope.
HDC
);
228
Assert.Equal(hdc, scope.
HDC
);
266
Assert.NotEqual(mockHdc, scope.
HDC
);
300
Assert.Equal(hdc, scope.
HDC
);
331
Assert.Equal(hdc, scope.
HDC
);