215 references to PrinterUnit
System.Drawing (1)
System.Drawing.cs (1)
125
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Printing.
PrinterUnit
))]
System.Drawing.Common (35)
System\Drawing\Printing\PageSettings.cs (12)
258
int length = PrinterUnitConvert.Convert(_paperSize.Height,
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter);
265
int width = PrinterUnitConvert.Convert(_paperSize.Width,
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter);
275
int length = PrinterUnitConvert.Convert(_paperSize.Height,
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter);
282
int width = PrinterUnitConvert.Convert(_paperSize.Width,
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter);
416
PrinterUnitConvert.Convert(devmode->Anonymous1.Anonymous1.dmPaperWidth,
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display),
417
PrinterUnitConvert.Convert(devmode->Anonymous1.Anonymous1.dmPaperLength,
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display));
System\Drawing\Printing\PreviewPrintController.cs (2)
56
Size metafileSize = PrinterUnitConvert.Convert(size,
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter);
System\Drawing\Printing\PrinterSettings.cs (4)
887
PrinterUnitConvert.Convert(sizes[i].Width,
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display),
888
PrinterUnitConvert.Convert(sizes[i].Height,
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display));
System\Drawing\Printing\PrinterUnitConvert.cs (17)
18
public static double Convert(double value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit)
28
public static int Convert(int value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit) =>
34
public static Point Convert(Point value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit) =>
40
public static Size Convert(Size value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit) =>
46
public static Rectangle Convert(Rectangle value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit) => new(
55
public static Margins Convert(Margins value,
PrinterUnit
fromUnit,
PrinterUnit
toUnit) => new()
63
private static double UnitsPerDisplay(
PrinterUnit
unit)
68
case
PrinterUnit
.Display:
71
case
PrinterUnit
.ThousandthsOfAnInch:
74
case
PrinterUnit
.HundredthsOfAMillimeter:
77
case
PrinterUnit
.TenthsOfAMillimeter:
System.Drawing.Common.Tests (170)
System\Drawing\Printing\PrinterUnitConvertTests.cs (170)
35
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.Display, 100)]
36
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter, 2540)]
37
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter, 254)]
38
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.ThousandthsOfAnInch, 1000)]
39
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.Display, 4)]
40
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 100)]
41
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 10)]
42
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 39)]
43
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display, 39)]
44
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 1000)]
45
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 100)]
46
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 394)]
47
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.Display, 10)]
48
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.HundredthsOfAMillimeter, 254)]
49
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.TenthsOfAMillimeter, 25)]
50
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.ThousandthsOfAnInch, 100)]
51
public void Convert_Int_ReturnsExpected(
PrinterUnit
fromUnit,
PrinterUnit
toUnit, int expectedResult)
58
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.Display, 100, 1000)]
59
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter, 2540, 25400)]
60
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter, 254, 2540)]
61
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.ThousandthsOfAnInch, 1000, 10000)]
62
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.Display, 4, 39)]
63
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 100, 1000)]
64
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 10, 100)]
65
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 39, 394)]
66
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display, 39, 394)]
67
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 1000, 10000)]
68
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 100, 1000)]
69
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 394, 3937)]
70
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.Display, 10, 100)]
71
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.HundredthsOfAMillimeter, 254, 2540)]
72
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.TenthsOfAMillimeter, 25, 254)]
73
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.ThousandthsOfAnInch, 100, 1000)]
74
public void Convert_Point_ReturnsExpected(
PrinterUnit
fromUnit,
PrinterUnit
toUnit, int expectedX, int expectedY)
81
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.Display, 100, 1000)]
82
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter, 2540, 25400)]
83
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter, 254, 2540)]
84
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.ThousandthsOfAnInch, 1000, 10000)]
85
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.Display, 4, 39)]
86
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 100, 1000)]
87
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 10, 100)]
88
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 39, 394)]
89
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display, 39, 394)]
90
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 1000, 10000)]
91
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 100, 1000)]
92
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 394, 3937)]
93
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.Display, 10, 100)]
94
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.HundredthsOfAMillimeter, 254, 2540)]
95
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.TenthsOfAMillimeter, 25, 254)]
96
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.ThousandthsOfAnInch, 100, 1000)]
97
public void Convert_Rectangle_ReturnsExpected(
PrinterUnit
fromUnit,
PrinterUnit
toUnit, int expectedLeftValue, int expectedRightValue)
104
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.Display, 100, 1000)]
105
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter, 2540, 25400)]
106
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter, 254, 2540)]
107
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.ThousandthsOfAnInch, 1000, 10000)]
108
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.Display, 4, 39)]
109
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 100, 1000)]
110
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 10, 100)]
111
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 39, 394)]
112
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display, 39, 394)]
113
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 1000, 10000)]
114
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 100, 1000)]
115
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 394, 3937)]
116
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.Display, 10, 100)]
117
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.HundredthsOfAMillimeter, 254, 2540)]
118
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.TenthsOfAMillimeter, 25, 254)]
119
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.ThousandthsOfAnInch, 100, 1000)]
120
public void Convert_Size_ReturnsExpected(
PrinterUnit
fromUnit,
PrinterUnit
toUnit, int expectedX, int expectedY)
127
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.Display, 100, 1000, 100, 1000)]
128
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.HundredthsOfAMillimeter, 2540, 25400, 2540, 25400)]
129
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.TenthsOfAMillimeter, 254, 2540, 254, 2540)]
130
[InlineData(
PrinterUnit
.Display,
PrinterUnit
.ThousandthsOfAnInch, 1000, 10000, 1000, 10000)]
131
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.Display, 4, 39, 4, 39)]
132
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 100, 1000, 100, 1000)]
133
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 10, 100, 10, 100)]
134
[InlineData(
PrinterUnit
.HundredthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 39, 394, 39, 394)]
135
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.Display, 39, 394, 39, 394)]
136
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.HundredthsOfAMillimeter, 1000, 10000, 1000, 10000)]
137
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.TenthsOfAMillimeter, 100, 1000, 100, 1000)]
138
[InlineData(
PrinterUnit
.TenthsOfAMillimeter,
PrinterUnit
.ThousandthsOfAnInch, 394, 3937, 394, 3937)]
139
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.Display, 10, 100, 10, 100)]
140
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.HundredthsOfAMillimeter, 254, 2540, 254, 2540)]
141
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.TenthsOfAMillimeter, 25, 254, 25, 254)]
142
[InlineData(
PrinterUnit
.ThousandthsOfAnInch,
PrinterUnit
.ThousandthsOfAnInch, 100, 1000, 100, 1000)]
143
public void Convert_Margins_ReturnsExpected(
PrinterUnit
fromUnit,
PrinterUnit
toUnit, int expectedLeft, int expectedRight, int expectedTop, int expectedBottom)
System.Windows.Forms (9)
System\Windows\Forms\Printing\PageSetupDialog.cs (9)
257
PrinterUnit
fromUnit = ((data.Flags & PAGESETUPDLG_FLAGS.PSD_INHUNDREDTHSOFMILLIMETERS) != 0)
258
?
PrinterUnit
.HundredthsOfAMillimeter
259
:
PrinterUnit
.ThousandthsOfAnInch;
261
pageSettings.Margins = PrinterUnitConvert.Convert(newMargins, fromUnit,
PrinterUnit
.Display);
279
PrinterUnit
toUnit =
PrinterUnit
.ThousandthsOfAnInch;
298
toUnit =
PrinterUnit
.HundredthsOfAMillimeter;
304
Margins margins = PrinterUnitConvert.Convert(MinMargins,
PrinterUnit
.Display, toUnit);
313
Margins margins = PrinterUnitConvert.Convert(_pageSettings.Margins,
PrinterUnit
.Display, toUnit);