67 instantiations of DeviceContextHdcScope
System.Private.Windows.GdiPlus (1)
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (1)
66/// Prefer to use <see cref="DeviceContextHdcScope(IHdcContext, bool, bool)"/>.
System.Windows.Forms (46)
System\Windows\Forms\Control.cs (6)
4994using DeviceContextHdcScope hDc = new(g, applyGraphicsState: false); 5005using DeviceContextHdcScope desthDC = new(destGraphics, applyGraphicsState: false); 7167using DeviceContextHdcScope hdc = new(e); 8202using DeviceContextHdcScope hdc = new(e); 8256using DeviceContextHdcScope hdcNoParent = new(e); 8297using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
350using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
82using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (5)
47using (DeviceContextHdcScope hdc = new(e)) 70using DeviceContextHdcScope hdc = new(e); 203using DeviceContextHdcScope hdc = new(g); 209using DeviceContextHdcScope hdc = new(e); 313using DeviceContextHdcScope hdc = new(offscreen, applyGraphicsState: false);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (3)
77using DeviceContextHdcScope hdc = new(e); 146using DeviceContextHdcScope hdc = new(e); 206using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (5)
73using DeviceContextHdcScope hdc = new(graphics); 78using (DeviceContextHdcScope hdc = new(graphics)) 128using (DeviceContextHdcScope hdc = new(g)) 217using (DeviceContextHdcScope hdc = new(g)) 253using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (1)
108using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
776using DeviceContextHdcScope hdc = new(g); 784using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (1)
1363using DeviceContextHdcScope hdc = new(offscreen);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
499using DeviceContextHdcScope hdc = new(e); 566using DeviceContextHdcScope hdc = new(e); 591using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Labels\Label.cs (1)
1262using (DeviceContextHdcScope hdc = new(e))
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
1130using (DeviceContextHdcScope scope = new(e, applyGraphicsState: false)) 1358using (DeviceContextHdcScope hdc = new(g, applyGraphicsState: false))
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
615using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (1)
92using (DeviceContextHdcScope hdc = new(pevent))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1693using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (2)
2653using DeviceContextHdcScope imageHdc = new(g, applyGraphicsState: false); 3489using DeviceContextHdcScope toolStripHDC = new(toolstripGraphics, ApplyGraphicsProperties.Clipping);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (2)
536using DeviceContextHdcScope hdc = new(e); 569using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (2)
273using DeviceContextHdcScope hdc = new(e); 323using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Form.cs (1)
4467using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Input\Cursor.cs (1)
256using DeviceContextHdcScope dc = new(graphics, applyGraphicsState: false);
System\Windows\Forms\Rendering\ControlPaint.cs (3)
1043using DeviceContextHdcScope hdc = new(graphics); 1371using DeviceContextHdcScope dc = new(g2, applyGraphicsState: false); 1441using (DeviceContextHdcScope hdc = new(g2, applyGraphicsState: false))
System\Windows\Forms\Rendering\TextRenderer.cs (1)
336using DeviceContextHdcScope graphicsHdc = new(e.GraphicsInternal, applyGraphicsState: false);
System.Windows.Forms.Design (5)
System\Windows\Forms\Design\DesignerUtils.cs (5)
248using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 263using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 278using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 401using DeviceContextHdcScope destDC = new(gDest, applyGraphicsState: false); 530using DeviceContextHdcScope dc = new(g, applyGraphicsState: false);
System.Windows.Forms.Primitives (2)
System\Windows\Forms\DeviceContextExtensions.cs (2)
184IHdcContext hdc => new(hdc, applyProperties), 185_ => new(new IDeviceContextAdapter(deviceContext), applyProperties)
System.Windows.Forms.Primitives.Tests (13)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (12)
27using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.TranslateTransform)) 42using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.Clipping)) 57using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.All)) 72using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.None)) 110using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.TranslateTransform)) 137using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.Clipping)) 160using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.All)) 183using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.None)) 226using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply)) 264using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply)) 298using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, ApplyGraphicsProperties.None)) 329using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply))
System\Windows\Forms\DeviceContextScopeTests.cs (1)
45using DeviceContextHdcScope hdcScope = new(graphics);
119 references to DeviceContextHdcScope
System.Private.Windows.GdiPlus (4)
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (3)
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;
Windows\Win32\Graphics\Gdi\IGraphicsHdcProvider.cs (1)
9/// Used to provide a way to give <see cref="DeviceContextHdcScope"/> direct internal access to HDC's.
System.Windows.Forms (88)
System\Windows\Forms\Control.cs (6)
4994using DeviceContextHdcScope hDc = new(g, applyGraphicsState: false); 5005using DeviceContextHdcScope desthDC = new(destGraphics, applyGraphicsState: false); 7167using DeviceContextHdcScope hdc = new(e); 8202using DeviceContextHdcScope hdc = new(e); 8256using DeviceContextHdcScope hdcNoParent = new(e); 8297using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.ColorOptions.cs (1)
111using DeviceContextHdcScope hdc = _deviceContext.ToHdcScope(ApplyGraphicsProperties.None);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (7)
136using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 191using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 239using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 297using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 350using DeviceContextHdcScope hdc = new(e); 360using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 446using DeviceContextHdcScope hdc = deviceContext.ToHdcScope();
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
82using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (6)
47using (DeviceContextHdcScope hdc = new(e)) 70using DeviceContextHdcScope hdc = new(e); 90using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 203using DeviceContextHdcScope hdc = new(g); 209using DeviceContextHdcScope hdc = new(e); 313using DeviceContextHdcScope hdc = new(offscreen, applyGraphicsState: false);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (3)
77using DeviceContextHdcScope hdc = new(e); 146using DeviceContextHdcScope hdc = new(e); 206using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (1)
99using DeviceContextHdcScope hdc = deviceContext.ToHdcScope();
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (2)
78using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 239using DeviceContextHdcScope hdc = deviceContext.ToHdcScope();
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (5)
73using DeviceContextHdcScope hdc = new(graphics); 78using (DeviceContextHdcScope hdc = new(graphics)) 128using (DeviceContextHdcScope hdc = new(g)) 217using (DeviceContextHdcScope hdc = new(g)) 253using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (1)
108using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
776using DeviceContextHdcScope hdc = new(g); 784using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (1)
1363using DeviceContextHdcScope hdc = new(offscreen);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (3)
499using DeviceContextHdcScope hdc = new(e); 566using DeviceContextHdcScope hdc = new(e); 591using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (1)
317using DeviceContextHdcScope hdc = deviceContext.ToHdcScope();
System\Windows\Forms\Controls\Labels\Label.cs (1)
1262using (DeviceContextHdcScope hdc = new(e))
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
1130using (DeviceContextHdcScope scope = new(e, applyGraphicsState: false)) 1358using (DeviceContextHdcScope hdc = new(g, applyGraphicsState: false))
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
615using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.cs (1)
92using (DeviceContextHdcScope hdc = new(pevent))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1693using DeviceContextHdcScope hdc = new(g);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (2)
2653using DeviceContextHdcScope imageHdc = new(g, applyGraphicsState: false); 3489using DeviceContextHdcScope toolStripHDC = new(toolstripGraphics, ApplyGraphicsProperties.Clipping);
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (2)
536using DeviceContextHdcScope hdc = new(e); 569using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (2)
273using DeviceContextHdcScope hdc = new(e); 323using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Form.cs (1)
4467using DeviceContextHdcScope hdc = new(e);
System\Windows\Forms\Input\Cursor.cs (1)
256using DeviceContextHdcScope dc = new(graphics, applyGraphicsState: false);
System\Windows\Forms\Rendering\ControlPaint.cs (14)
715using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 747using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 774using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 806using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 833using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 875using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 907using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 949using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 1043using DeviceContextHdcScope hdc = new(graphics); 1168using DeviceContextHdcScope hdc = context.ToHdcScope(); 1371using DeviceContextHdcScope dc = new(g2, applyGraphicsState: false); 1441using (DeviceContextHdcScope hdc = new(g2, applyGraphicsState: false)) 1922using DeviceContextHdcScope hdc = deviceContext.ToHdcScope(); 1985using DeviceContextHdcScope hdc = dc.ToHdcScope(TextRenderer.GetApplyStateFlags(dc, format));
System\Windows\Forms\Rendering\TextRenderer.cs (3)
307using DeviceContextHdcScope hdc = dc.ToHdcScope(GetApplyStateFlags(dc, flags)); 336using DeviceContextHdcScope graphicsHdc = new(e.GraphicsInternal, applyGraphicsState: false); 543using DeviceContextHdcScope hdc = dc.ToHdcScope(GetApplyStateFlags(dc, flags));
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (17)
215using DeviceContextHdcScope hdc = dc.ToHdcScope(); 244using DeviceContextHdcScope hdc = dc.ToHdcScope(); 271using DeviceContextHdcScope hdc = dc.ToHdcScope(); 347using DeviceContextHdcScope hdc = dc.ToHdcScope(); 375using DeviceContextHdcScope hdc = dc.ToHdcScope(); 409using DeviceContextHdcScope hdc = dc.ToHdcScope(); 436using DeviceContextHdcScope hdc = dc.ToHdcScope(); 455using DeviceContextHdcScope hdc = dc.ToHdcScope(); 536using DeviceContextHdcScope hdc = dc.ToHdcScope(); 575using DeviceContextHdcScope hdc = dc.ToHdcScope(); 605using DeviceContextHdcScope hdc = dc.ToHdcScope(); 632using DeviceContextHdcScope hdc = dc.ToHdcScope(); 663using DeviceContextHdcScope hdc = dc.ToHdcScope(); 686using DeviceContextHdcScope hdc = dc.ToHdcScope(); 708using DeviceContextHdcScope hdc = dc.ToHdcScope(); 720using DeviceContextHdcScope hdc = dc.ToHdcScope(); 754using DeviceContextHdcScope hdc = dc.ToHdcScope();
System.Windows.Forms.Design (5)
System\Windows\Forms\Design\DesignerUtils.cs (5)
248using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 263using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 278using DeviceContextHdcScope hDC = new(graphics, applyGraphicsState: false); 401using DeviceContextHdcScope destDC = new(gDest, applyGraphicsState: false); 530using DeviceContextHdcScope dc = new(g, applyGraphicsState: false);
System.Windows.Forms.Primitives (9)
System\Windows\Forms\DeviceContextExtensions.cs (9)
13internal static void DrawRectangle(this DeviceContextHdcScope hdc, Rectangle rectangle, HPEN hpen) => 17this DeviceContextHdcScope hdc, 40internal static void FillRectangle(this DeviceContextHdcScope hdc, Rectangle rectangle, HBRUSH hbrush) => 53internal static void DrawLine(this DeviceContextHdcScope hdc, HPEN hpen, Point p1, Point p2) => 59internal static void DrawLine(this DeviceContextHdcScope hdc, HPEN hpen, int x1, int y1, int x2, int y2) => 71internal static void DrawLines(this DeviceContextHdcScope hdc, HPEN hpen, ReadOnlySpan<int> lines) => 98internal static Color FindNearestColor(this DeviceContextHdcScope hdc, Color color) => FindNearestColor(hdc.HDC, color); 128this DeviceContextHdcScope hdc, 180internal static DeviceContextHdcScope ToHdcScope(
System.Windows.Forms.Primitives.Tests (13)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (12)
27using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.TranslateTransform)) 42using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.Clipping)) 57using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.All)) 72using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.None)) 110using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.TranslateTransform)) 137using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.Clipping)) 160using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.All)) 183using (DeviceContextHdcScope scope = new(g, ApplyGraphicsProperties.None)) 226using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply)) 264using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply)) 298using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, ApplyGraphicsProperties.None)) 329using (DeviceContextHdcScope scope = new(mockIDeviceContext.Object, (ApplyGraphicsProperties)apply))
System\Windows\Forms\DeviceContextScopeTests.cs (1)
45using DeviceContextHdcScope hdcScope = new(graphics);