4 writes to HDC
System.Private.Windows.GdiPlus (4)
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (4)
94HDC = default; 130HDC = needToApplyProperties ? default : provider.GetHdc(); 146HDC = 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. 132if (HDC.IsNull) 146HDC = HDC.IsNull ? DeviceContext.GetHdc() : HDC; 148_savedHdcState = saveHdcState ? PInvokeCore.SaveDC(HDC) : 0; 158public static implicit operator HDC(in DeviceContextHdcScope scope) => scope.HDC; 159public static implicit operator nint(in DeviceContextHdcScope scope) => scope.HDC; 160public static explicit operator WPARAM(in DeviceContextHdcScope scope) => (WPARAM)scope.HDC; 165if (HDC.IsNull) 174OBJ_TYPE type = (OBJ_TYPE)PInvokeCore.GetObjectType(HDC); 194PInvokeCore.RestoreDC(HDC, _savedHdcState);
System.Windows.Forms (4)
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (2)
515textSize = hdc.HDC.MeasureText(Text, hfont, new Size(textRectangle.Width, int.MaxValue), (TextFormatFlags)flags); 519hdc.HDC.DrawText(Text, hfont, textRectangle, ForeColor, (TextFormatFlags)flags);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
1132foreColor = scope.HDC.FindNearestColor(DisabledColor);
System\Windows\Forms\Rendering\TextRenderer.cs (1)
545return hdc.HDC.MeasureText(text, hfont, proposedSize, flags);
System.Windows.Forms.Primitives (8)
System\Windows\Forms\DeviceContextExtensions.cs (8)
14DrawRectangle(hdc.HDC, rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom, hpen); 23DrawRectangle(hdc.HDC, left, top, right, bottom, hpen); 41FillRectangle(hdc.HDC, rectangle, hbrush); 54DrawLine(hdc.HDC, hpen, p1.X, p1.Y, p2.X, p2.Y); 60DrawLine(hdc.HDC, hpen, x1, y1, x2, y2); 72DrawLines(hdc.HDC, hpen, lines); 98internal static Color FindNearestColor(this DeviceContextHdcScope hdc, Color color) => FindNearestColor(hdc.HDC, color); 132DrawAndFillEllipse(hdc.HDC, pen, brush, bounds.Left, bounds.Top, bounds.Right, bounds.Bottom);
System.Windows.Forms.Primitives.Tests (8)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (8)
125Assert.Equal(hdc, scope.HDC); 149Assert.Equal(hdc, scope.HDC); 172Assert.Equal(hdc, scope.HDC); 195Assert.Equal(hdc, scope.HDC); 228Assert.Equal(hdc, scope.HDC); 266Assert.NotEqual(mockHdc, scope.HDC); 300Assert.Equal(hdc, scope.HDC); 331Assert.Equal(hdc, scope.HDC);