2 writes to _hdc
System.Drawing.Common (2)
System\Drawing\Printing\DefaultPrintController.cs (2)
32
_hdc
= new(document.PrinterSettings.CreateDeviceContext(_modeHandle));
151
_hdc
= null;
14 references to _hdc
System.Drawing.Common (14)
System\Drawing\Printing\DefaultPrintController.cs (14)
17
HDC IHandle<HDC>.Handle =>
_hdc
?.Handle ?? HDC.Null;
24
Debug.Assert(
_hdc
is null && _graphics is null, "PrintController methods called in the wrong order?");
73
Debug.Assert(
_hdc
is not null && _graphics is null, "PrintController methods called in the wrong order?");
81
HDC result = PInvoke.ResetDCW(
_hdc
, devmode);
82
Debug.Assert(result ==
_hdc
, "ResetDC didn't return the same handle");
89
_graphics = Graphics.FromHdcInternal(
_hdc
);
94
int dpiX = PInvokeCore.GetDeviceCaps(
_hdc
, GET_DEVICE_CAPS_INDEX.LOGPIXELSX);
95
int dpiY = PInvokeCore.GetDeviceCaps(
_hdc
, GET_DEVICE_CAPS_INDEX.LOGPIXELSY);
96
int hardMarginX_DU = PInvokeCore.GetDeviceCaps(
_hdc
, GET_DEVICE_CAPS_INDEX.PHYSICALOFFSETX);
97
int hardMarginY_DU = PInvokeCore.GetDeviceCaps(
_hdc
, GET_DEVICE_CAPS_INDEX.PHYSICALOFFSETY);
114
Debug.Assert(
_hdc
is not null && _graphics is not null, "PrintController methods called in the wrong order?");
138
Debug.Assert(
_hdc
is not null && _graphics is null, "PrintController methods called in the wrong order?");
140
if (
_hdc
is not null)
150
_hdc
.Dispose();