5 implementations of IDeviceContext
System.Drawing.Common (1)
Special\NotSupported.cs (1)
431
public sealed partial class Graphics : System.MarshalByRefObject, System.Drawing.
IDeviceContext
, System.IDisposable
System.Windows.Forms (2)
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (1)
14
public class DrawItemEventArgs : EventArgs, IDisposable,
IDeviceContext
, IGraphicsHdcProvider, IHdcContext
System\Windows\Forms\Rendering\PaintEventArgs.cs (1)
18
public partial class PaintEventArgs : EventArgs, IDisposable,
IDeviceContext
, IGraphicsHdcProvider, IHdcContext
System.Windows.Forms.Primitives.TestUtilities (1)
HdcDeviceContextAdapter.cs (1)
12
internal class HdcDeviceContextAdapter :
IDeviceContext
System.Windows.Forms.Tests (1)
System\Windows\Forms\TextRendererTests.cs (1)
659
private class MockDC :
IDeviceContext
112 references to IDeviceContext
System.Drawing (1)
System.Drawing.cs (1)
64
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
IDeviceContext
))]
System.Windows.Forms (97)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.ColorOptions.cs (2)
14
private readonly
IDeviceContext
_deviceContext;
19
internal ColorOptions(
IDeviceContext
deviceContext, Color foreColor, Color backColor)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (12)
103
protected void Draw3DBorder(
IDeviceContext
deviceContext, Rectangle bounds, ColorData colors, bool raised)
129
private void Draw3DBorderHighContrastRaised(
IDeviceContext
deviceContext, ref Rectangle bounds, ColorData colors)
187
private static void Draw3DBorderNormal(
IDeviceContext
deviceContext, ref Rectangle bounds, ColorData colors)
232
private void Draw3DBorderRaised(
IDeviceContext
deviceContext, ref Rectangle bounds, ColorData colors)
294
protected internal static void Draw3DLiteBorder(
IDeviceContext
deviceContext, Rectangle r, ColorData colors, bool up)
356
internal static void DrawFlatFocus(
IDeviceContext
deviceContext, Rectangle r, Color color)
423
internal static void DrawDefaultBorder(
IDeviceContext
deviceContext, Rectangle r, Color color, bool isDefault)
632
IDeviceContext
deviceContext,
640
private ColorOptions CommonRender(
IDeviceContext
deviceContext) =>
646
protected ColorOptions PaintRender(
IDeviceContext
deviceContext) => CommonRender(deviceContext);
651
protected ColorOptions PaintFlatRender(
IDeviceContext
deviceContext) => CommonRender(deviceContext);
656
protected ColorOptions PaintPopupRender(
IDeviceContext
deviceContext) => CommonRender(deviceContext);
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
85
IDeviceContext
deviceContext,
System\Windows\Forms\Controls\Buttons\ButtonRenderer.cs (7)
54
=> DrawParentBackground((
IDeviceContext
)g, bounds, childControl);
56
internal static void DrawParentBackground(
IDeviceContext
dc, Rectangle bounds, Control childControl)
67
DrawButton((
IDeviceContext
)g, bounds, state);
69
internal static void DrawButton(
IDeviceContext
deviceContext, Rectangle bounds, PushButtonState state)
87
IDeviceContext
deviceContext,
230
=> DrawButton((
IDeviceContext
)g, bounds, buttonText, font, flags, image, imageBounds, focused, state);
233
IDeviceContext
deviceContext,
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (3)
71
IDeviceContext
deviceContext,
230
public static Size GetGlyphSize(Graphics g, CheckBoxState state) => GetGlyphSize((
IDeviceContext
)g, state);
232
internal static Size GetGlyphSize(
IDeviceContext
deviceContext, CheckBoxState state, HWND hwnd = default)
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (6)
102
=> DrawGroupBox((
IDeviceContext
)g, bounds, groupBoxText, font, flags, state);
105
IDeviceContext
deviceContext,
133
=> DrawGroupBox((
IDeviceContext
)g, bounds, groupBoxText, font, textColor, flags, state);
136
IDeviceContext
deviceContext,
167
IDeviceContext
deviceContext,
273
IDeviceContext
deviceContext,
System\Windows\Forms\Controls\TabControl\TabRenderer.cs (2)
143
=> DrawTabPage((
IDeviceContext
)g, bounds);
145
internal static void DrawTabPage(
IDeviceContext
deviceContext, Rectangle bounds)
System\Windows\Forms\Rendering\ControlPaint.cs (5)
558
(
IDeviceContext
)graphics,
567
IDeviceContext
deviceContext,
1141
IDeviceContext
context,
1913
IDeviceContext
deviceContext,
1977
IDeviceContext
dc,
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (4)
161
IntPtr
IDeviceContext
.GetHdc() => Graphics?.GetHdc() ?? IntPtr.Zero;
162
HDC IHdcContext.GetHdc() => (HDC)((
IDeviceContext
)this).GetHdc();
163
void
IDeviceContext
.ReleaseHdc() => Graphics?.ReleaseHdc();
164
void IHdcContext.ReleaseHdc() => ((
IDeviceContext
)this).ReleaseHdc();
System\Windows\Forms\Rendering\PaintEventArgs.cs (4)
134
IntPtr
IDeviceContext
.GetHdc() => Graphics?.GetHdc() ?? IntPtr.Zero;
135
HDC IHdcContext.GetHdc() => (HDC)((
IDeviceContext
)this).GetHdc();
136
void
IDeviceContext
.ReleaseHdc() => Graphics?.ReleaseHdc();
137
void IHdcContext.ReleaseHdc() => ((
IDeviceContext
)this).ReleaseHdc();
System\Windows\Forms\Rendering\TextRenderer.cs (32)
25
public static void DrawText(
IDeviceContext
dc, string? text, Font? font, Point pt, Color foreColor)
37
public static void DrawText(
IDeviceContext
dc, ReadOnlySpan<char> text, Font font, Point pt, Color foreColor)
41
IDeviceContext
dc,
60
IDeviceContext
dc,
69
IDeviceContext
dc,
92
IDeviceContext
dc,
108
IDeviceContext
dc,
133
IDeviceContext
dc,
149
public static void DrawText(
IDeviceContext
dc, string? text, Font? font, Rectangle bounds, Color foreColor)
162
IDeviceContext
dc,
170
IDeviceContext
dc,
190
IDeviceContext
dc,
199
IDeviceContext
dc,
222
IDeviceContext
dc,
238
IDeviceContext
dc,
263
IDeviceContext
dc,
280
IDeviceContext
dc,
290
IDeviceContext
dc,
392
/// <see cref="DrawText(
IDeviceContext
, ReadOnlySpan{char}, Font?, Rectangle, Color, TextFormatFlags)"/>
396
/// versions of <see cref="DrawText(
IDeviceContext
, ReadOnlySpan{char}, Font, Point, Color)"/> and
397
/// <see cref="MeasureText(
IDeviceContext
, ReadOnlySpan{char}, Font?)"/> that take a Size and
399
/// <see cref="MeasureText(
IDeviceContext
, string?, Font?, Size, TextFormatFlags)"/>.
442
public static Size MeasureText(
IDeviceContext
dc, string? text, Font? font)
456
public static Size MeasureText(
IDeviceContext
dc, ReadOnlySpan<char> text, Font? font)
459
public static Size MeasureText(
IDeviceContext
dc, string? text, Font? font, Size proposedSize)
475
public static Size MeasureText(
IDeviceContext
dc, ReadOnlySpan<char> text, Font? font, Size proposedSize)
479
IDeviceContext
dc,
504
IDeviceContext
dc,
527
IDeviceContext
dc,
566
internal static FONT_QUALITY FontQualityFromTextRenderingHint(
IDeviceContext
? deviceContext)
584
/// Returns what <see cref="FontQualityFromTextRenderingHint(
IDeviceContext
?)"/> would return in an
602
internal static ApplyGraphicsProperties GetApplyStateFlags(
IDeviceContext
deviceContext, TextFormatFlags textFormatFlags)
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (19)
211
public void DrawBackground(
IDeviceContext
dc, Rectangle bounds)
240
public void DrawBackground(
IDeviceContext
dc, Rectangle bounds, Rectangle clipRectangle)
267
public Rectangle DrawEdge(
IDeviceContext
dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects)
335
public void DrawParentBackground(
IDeviceContext
dc, Rectangle bounds, Control childControl)
355
public void DrawText(
IDeviceContext
dc, Rectangle bounds, string? textToDraw)
363
public void DrawText(
IDeviceContext
dc, Rectangle bounds, string? textToDraw, bool drawDisabled)
371
public void DrawText(
IDeviceContext
dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags)
405
public Rectangle GetBackgroundContentRectangle(
IDeviceContext
dc, Rectangle bounds)
427
public Rectangle GetBackgroundExtent(
IDeviceContext
dc, Rectangle contentBounds)
446
public unsafe Region? GetBackgroundRegion(
IDeviceContext
dc, Rectangle bounds)
530
public Font? GetFont(
IDeviceContext
dc, FontProperty prop)
571
public Size GetPartSize(
IDeviceContext
dc, ThemeSizeType type)
598
public unsafe Size GetPartSize(
IDeviceContext
dc, Rectangle bounds, ThemeSizeType type)
625
public unsafe Padding GetMargins(
IDeviceContext
dc, MarginProperty prop)
658
public unsafe Rectangle GetTextExtent(
IDeviceContext
dc, string textToDraw, TextFormatFlags flags)
681
public unsafe Rectangle GetTextExtent(
IDeviceContext
dc, Rectangle bounds, string textToDraw, TextFormatFlags flags)
704
public TextMetrics GetTextMetrics(
IDeviceContext
dc)
716
public HitTestCode HitTestBackground(
IDeviceContext
dc, Rectangle backgroundRectangle, Point pt, HitTestOptions options)
750
public HitTestCode HitTestBackground(
IDeviceContext
dc, Rectangle backgroundRectangle, IntPtr hRgn, Point pt, HitTestOptions options)
System.Windows.Forms.Design (1)
System\ComponentModel\Design\CollectionEditor.SplitButton.cs (1)
242
private static void PaintArrow(
IDeviceContext
deviceContext, Rectangle dropDownRect)
System.Windows.Forms.Primitives (4)
System\Windows\Forms\DeviceContextExtensions.cs (2)
173
internal static Graphics? TryGetGraphics(this
IDeviceContext
deviceContext, bool create = false) => deviceContext switch
181
this
IDeviceContext
deviceContext,
System\Windows\Forms\DeviceContextExtensions.IDeviceContextAdapter.cs (2)
12
private readonly
IDeviceContext
_deviceContext;
13
public IDeviceContextAdapter(
IDeviceContext
deviceContext) => _deviceContext = deviceContext;
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 (8)
System\Windows\Forms\TextRendererTests.cs (8)
313
Mock<
IDeviceContext
> mockDeviceContext = new(MockBehavior.Strict);
538
Mock<
IDeviceContext
> mockDeviceContext = new(MockBehavior.Strict);
571
public unsafe void TextRenderer_DrawText_DefaultBackground_RendersTransparent(Func<
IDeviceContext
, Action> func)
587
public static TheoryData<Func<
IDeviceContext
, Action>> TextRenderer_DrawText_DefaultBackground_RendersTransparent_TestData
590
(
IDeviceContext
context) => () =>
593
(
IDeviceContext
context) => () =>
596
(
IDeviceContext
context) => () =>
599
(
IDeviceContext
context) => () =>