207 references to Pens
System.Drawing (1)
System.Drawing.cs (1)
104
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
Pens
))]
System.Drawing.Common.Tests (177)
mono\System.Drawing\GraphicsTests.cs (16)
716
g.DrawCurve(
Pens
.Black, s_tooSmallCurve, 0.5f);
729
Assert.Throws<ArgumentException>(() => g.DrawCurve(
Pens
.Black, [new(10, 10)], 0.5f));
739
Assert.Throws<ArgumentException>(() => g.DrawCurve(
Pens
.Black, s_tooSmallCurve, 0, 2, 0.5f));
750
g.DrawCurve(
Pens
.Black, s_smallCurveF, -0.9f);
761
g.DrawCurve(
Pens
.Black, s_smallCurveF, 0.9f);
773
Assert.Throws<ArgumentException>(() => g.DrawCurve(
Pens
.Black, s_smallCurveF, 0, 0));
781
Assert.Throws<ArgumentException>(() => g.DrawCurve(
Pens
.Black, s_smallCurveF, 0, -1));
790
Assert.Throws<ArgumentException>(() => g.DrawCurve(
Pens
.Black, s_smallCurveF, 1, 2));
800
g.DrawCurve(
Pens
.Black, s_largeCurveF, 0, 2, 0.5f);
811
g.DrawCurve(
Pens
.Black, s_largeCurveF, 1, 2, 0.5f);
823
g.DrawCurve(
Pens
.Black, s_largeCurveF, 2, 1, 0.5f);
1223
g.DrawRectangle(
Pens
.Blue, rect);
1386
g.DrawRectangle(
Pens
.Blue, rect);
1532
g.DrawLines(
Pens
.Blue, pts);
2865
Assert.Throws<ArgumentNullException>(() => g.DrawPath(
Pens
.Black, null));
2887
g.DrawPath(
Pens
.SteelBlue, path);
System\Drawing\Drawing2D\GraphicsPathTests.cs (15)
2250
Assert.True(gp.IsOutlineVisible(10, 1,
Pens
.Red, graphics));
2252
Assert.False(gp.IsOutlineVisible(10, 2,
Pens
.Red, graphics));
2254
Assert.True(gp.IsOutlineVisible(11.0f, 1.0f,
Pens
.Red, graphics));
2256
Assert.False(gp.IsOutlineVisible(11.0f, 2.0f,
Pens
.Red, graphics));
2259
Assert.False(gp.IsOutlineVisible(point,
Pens
.Red, graphics));
2263
Assert.True(gp.IsOutlineVisible(point,
Pens
.Red, graphics));
2266
Assert.False(gp.IsOutlineVisible(fPoint,
Pens
.Red, graphics));
2270
Assert.True(gp.IsOutlineVisible(fPoint,
Pens
.Red, graphics));
2278
Assert.True(gp.IsOutlineVisible(10, 10,
Pens
.Red, graphics));
2280
Assert.False(gp.IsOutlineVisible(11, 11,
Pens
.Red, graphics));
2282
Assert.True(gp.IsOutlineVisible(11.0f, 10.0f,
Pens
.Red, graphics));
2284
Assert.False(gp.IsOutlineVisible(11.0f, 11.0f,
Pens
.Red, graphics));
2287
Assert.True(gp.IsOutlineVisible(point,
Pens
.Red, graphics));
2291
Assert.False(gp.IsOutlineVisible(point,
Pens
.Red, graphics));
2294
Assert.False(gp.IsOutlineVisible(fPoint,
Pens
.Red, graphics));
System\Drawing\GraphicsTests.cs (2)
2935
graphics.DrawRoundedRectangle(
Pens
.Red, new(0, 0, 10, 10), new(2, 2));
2944
graphics.DrawRoundedRectangle(
Pens
.Red, new RectangleF(0, 0, 10, 10), new(2, 2));
System\Drawing\PensTests.cs (141)
12
yield return Pen(() =>
Pens
.AliceBlue, Color.AliceBlue);
13
yield return Pen(() =>
Pens
.AntiqueWhite, Color.AntiqueWhite);
14
yield return Pen(() =>
Pens
.Aqua, Color.Aqua);
15
yield return Pen(() =>
Pens
.Aquamarine, Color.Aquamarine);
16
yield return Pen(() =>
Pens
.Azure, Color.Azure);
17
yield return Pen(() =>
Pens
.Beige, Color.Beige);
18
yield return Pen(() =>
Pens
.Bisque, Color.Bisque);
19
yield return Pen(() =>
Pens
.Black, Color.Black);
20
yield return Pen(() =>
Pens
.BlanchedAlmond, Color.BlanchedAlmond);
21
yield return Pen(() =>
Pens
.Blue, Color.Blue);
22
yield return Pen(() =>
Pens
.BlueViolet, Color.BlueViolet);
23
yield return Pen(() =>
Pens
.Brown, Color.Brown);
24
yield return Pen(() =>
Pens
.BurlyWood, Color.BurlyWood);
25
yield return Pen(() =>
Pens
.CadetBlue, Color.CadetBlue);
26
yield return Pen(() =>
Pens
.Chartreuse, Color.Chartreuse);
27
yield return Pen(() =>
Pens
.Chocolate, Color.Chocolate);
28
yield return Pen(() =>
Pens
.Coral, Color.Coral);
29
yield return Pen(() =>
Pens
.CornflowerBlue, Color.CornflowerBlue);
30
yield return Pen(() =>
Pens
.Cornsilk, Color.Cornsilk);
31
yield return Pen(() =>
Pens
.Crimson, Color.Crimson);
32
yield return Pen(() =>
Pens
.Cyan, Color.Cyan);
33
yield return Pen(() =>
Pens
.DarkBlue, Color.DarkBlue);
34
yield return Pen(() =>
Pens
.DarkCyan, Color.DarkCyan);
35
yield return Pen(() =>
Pens
.DarkGoldenrod, Color.DarkGoldenrod);
36
yield return Pen(() =>
Pens
.DarkGray, Color.DarkGray);
37
yield return Pen(() =>
Pens
.DarkGreen, Color.DarkGreen);
38
yield return Pen(() =>
Pens
.DarkKhaki, Color.DarkKhaki);
39
yield return Pen(() =>
Pens
.DarkMagenta, Color.DarkMagenta);
40
yield return Pen(() =>
Pens
.DarkOliveGreen, Color.DarkOliveGreen);
41
yield return Pen(() =>
Pens
.DarkOrange, Color.DarkOrange);
42
yield return Pen(() =>
Pens
.DarkOrchid, Color.DarkOrchid);
43
yield return Pen(() =>
Pens
.DarkRed, Color.DarkRed);
44
yield return Pen(() =>
Pens
.DarkSalmon, Color.DarkSalmon);
45
yield return Pen(() =>
Pens
.DarkSeaGreen, Color.DarkSeaGreen);
46
yield return Pen(() =>
Pens
.DarkSlateBlue, Color.DarkSlateBlue);
47
yield return Pen(() =>
Pens
.DarkSlateGray, Color.DarkSlateGray);
48
yield return Pen(() =>
Pens
.DarkTurquoise, Color.DarkTurquoise);
49
yield return Pen(() =>
Pens
.DarkViolet, Color.DarkViolet);
50
yield return Pen(() =>
Pens
.DeepPink, Color.DeepPink);
51
yield return Pen(() =>
Pens
.DeepSkyBlue, Color.DeepSkyBlue);
52
yield return Pen(() =>
Pens
.DimGray, Color.DimGray);
53
yield return Pen(() =>
Pens
.DodgerBlue, Color.DodgerBlue);
54
yield return Pen(() =>
Pens
.Firebrick, Color.Firebrick);
55
yield return Pen(() =>
Pens
.FloralWhite, Color.FloralWhite);
56
yield return Pen(() =>
Pens
.ForestGreen, Color.ForestGreen);
57
yield return Pen(() =>
Pens
.Fuchsia, Color.Fuchsia);
58
yield return Pen(() =>
Pens
.Gainsboro, Color.Gainsboro);
59
yield return Pen(() =>
Pens
.GhostWhite, Color.GhostWhite);
60
yield return Pen(() =>
Pens
.Gold, Color.Gold);
61
yield return Pen(() =>
Pens
.Goldenrod, Color.Goldenrod);
62
yield return Pen(() =>
Pens
.Gray, Color.Gray);
63
yield return Pen(() =>
Pens
.Green, Color.Green);
64
yield return Pen(() =>
Pens
.GreenYellow, Color.GreenYellow);
65
yield return Pen(() =>
Pens
.Honeydew, Color.Honeydew);
66
yield return Pen(() =>
Pens
.HotPink, Color.HotPink);
67
yield return Pen(() =>
Pens
.IndianRed, Color.IndianRed);
68
yield return Pen(() =>
Pens
.Indigo, Color.Indigo);
69
yield return Pen(() =>
Pens
.Ivory, Color.Ivory);
70
yield return Pen(() =>
Pens
.Khaki, Color.Khaki);
71
yield return Pen(() =>
Pens
.Lavender, Color.Lavender);
72
yield return Pen(() =>
Pens
.LavenderBlush, Color.LavenderBlush);
73
yield return Pen(() =>
Pens
.LawnGreen, Color.LawnGreen);
74
yield return Pen(() =>
Pens
.LemonChiffon, Color.LemonChiffon);
75
yield return Pen(() =>
Pens
.LightBlue, Color.LightBlue);
76
yield return Pen(() =>
Pens
.LightCoral, Color.LightCoral);
77
yield return Pen(() =>
Pens
.LightCyan, Color.LightCyan);
78
yield return Pen(() =>
Pens
.LightGoldenrodYellow, Color.LightGoldenrodYellow);
79
yield return Pen(() =>
Pens
.LightGray, Color.LightGray);
80
yield return Pen(() =>
Pens
.LightGreen, Color.LightGreen);
81
yield return Pen(() =>
Pens
.LightPink, Color.LightPink);
82
yield return Pen(() =>
Pens
.LightSalmon, Color.LightSalmon);
83
yield return Pen(() =>
Pens
.LightSeaGreen, Color.LightSeaGreen);
84
yield return Pen(() =>
Pens
.LightSkyBlue, Color.LightSkyBlue);
85
yield return Pen(() =>
Pens
.LightSlateGray, Color.LightSlateGray);
86
yield return Pen(() =>
Pens
.LightSteelBlue, Color.LightSteelBlue);
87
yield return Pen(() =>
Pens
.LightYellow, Color.LightYellow);
88
yield return Pen(() =>
Pens
.Lime, Color.Lime);
89
yield return Pen(() =>
Pens
.LimeGreen, Color.LimeGreen);
90
yield return Pen(() =>
Pens
.Linen, Color.Linen);
91
yield return Pen(() =>
Pens
.Magenta, Color.Magenta);
92
yield return Pen(() =>
Pens
.Maroon, Color.Maroon);
93
yield return Pen(() =>
Pens
.MediumAquamarine, Color.MediumAquamarine);
94
yield return Pen(() =>
Pens
.MediumBlue, Color.MediumBlue);
95
yield return Pen(() =>
Pens
.MediumOrchid, Color.MediumOrchid);
96
yield return Pen(() =>
Pens
.MediumPurple, Color.MediumPurple);
97
yield return Pen(() =>
Pens
.MediumSeaGreen, Color.MediumSeaGreen);
98
yield return Pen(() =>
Pens
.MediumSlateBlue, Color.MediumSlateBlue);
99
yield return Pen(() =>
Pens
.MediumSpringGreen, Color.MediumSpringGreen);
100
yield return Pen(() =>
Pens
.MediumTurquoise, Color.MediumTurquoise);
101
yield return Pen(() =>
Pens
.MediumVioletRed, Color.MediumVioletRed);
102
yield return Pen(() =>
Pens
.MidnightBlue, Color.MidnightBlue);
103
yield return Pen(() =>
Pens
.MintCream, Color.MintCream);
104
yield return Pen(() =>
Pens
.MistyRose, Color.MistyRose);
105
yield return Pen(() =>
Pens
.Moccasin, Color.Moccasin);
106
yield return Pen(() =>
Pens
.NavajoWhite, Color.NavajoWhite);
107
yield return Pen(() =>
Pens
.Navy, Color.Navy);
108
yield return Pen(() =>
Pens
.OldLace, Color.OldLace);
109
yield return Pen(() =>
Pens
.Olive, Color.Olive);
110
yield return Pen(() =>
Pens
.OliveDrab, Color.OliveDrab);
111
yield return Pen(() =>
Pens
.Orange, Color.Orange);
112
yield return Pen(() =>
Pens
.OrangeRed, Color.OrangeRed);
113
yield return Pen(() =>
Pens
.Orchid, Color.Orchid);
114
yield return Pen(() =>
Pens
.PaleGoldenrod, Color.PaleGoldenrod);
115
yield return Pen(() =>
Pens
.PaleGreen, Color.PaleGreen);
116
yield return Pen(() =>
Pens
.PaleTurquoise, Color.PaleTurquoise);
117
yield return Pen(() =>
Pens
.PaleVioletRed, Color.PaleVioletRed);
118
yield return Pen(() =>
Pens
.PapayaWhip, Color.PapayaWhip);
119
yield return Pen(() =>
Pens
.PeachPuff, Color.PeachPuff);
120
yield return Pen(() =>
Pens
.Peru, Color.Peru);
121
yield return Pen(() =>
Pens
.Pink, Color.Pink);
122
yield return Pen(() =>
Pens
.Plum, Color.Plum);
123
yield return Pen(() =>
Pens
.PowderBlue, Color.PowderBlue);
124
yield return Pen(() =>
Pens
.Purple, Color.Purple);
125
yield return Pen(() =>
Pens
.Red, Color.Red);
126
yield return Pen(() =>
Pens
.RosyBrown, Color.RosyBrown);
127
yield return Pen(() =>
Pens
.RoyalBlue, Color.RoyalBlue);
128
yield return Pen(() =>
Pens
.SaddleBrown, Color.SaddleBrown);
129
yield return Pen(() =>
Pens
.Salmon, Color.Salmon);
130
yield return Pen(() =>
Pens
.SandyBrown, Color.SandyBrown);
131
yield return Pen(() =>
Pens
.SeaGreen, Color.SeaGreen);
132
yield return Pen(() =>
Pens
.SeaShell, Color.SeaShell);
133
yield return Pen(() =>
Pens
.Sienna, Color.Sienna);
134
yield return Pen(() =>
Pens
.Silver, Color.Silver);
135
yield return Pen(() =>
Pens
.SkyBlue, Color.SkyBlue);
136
yield return Pen(() =>
Pens
.SlateBlue, Color.SlateBlue);
137
yield return Pen(() =>
Pens
.SlateGray, Color.SlateGray);
138
yield return Pen(() =>
Pens
.Snow, Color.Snow);
139
yield return Pen(() =>
Pens
.SpringGreen, Color.SpringGreen);
140
yield return Pen(() =>
Pens
.SteelBlue, Color.SteelBlue);
141
yield return Pen(() =>
Pens
.Tan, Color.Tan);
142
yield return Pen(() =>
Pens
.Teal, Color.Teal);
143
yield return Pen(() =>
Pens
.Thistle, Color.Thistle);
144
yield return Pen(() =>
Pens
.Tomato, Color.Tomato);
145
yield return Pen(() =>
Pens
.Transparent, Color.Transparent);
146
yield return Pen(() =>
Pens
.Turquoise, Color.Turquoise);
147
yield return Pen(() =>
Pens
.Violet, Color.Violet);
148
yield return Pen(() =>
Pens
.Wheat, Color.Wheat);
149
yield return Pen(() =>
Pens
.White, Color.White);
150
yield return Pen(() =>
Pens
.WhiteSmoke, Color.WhiteSmoke);
151
yield return Pen(() =>
Pens
.Yellow, Color.Yellow);
152
yield return Pen(() =>
Pens
.YellowGreen, Color.YellowGreen);
System\Drawing\RegionTests.cs (3)
482
graphics.DrawRectangle(
Pens
.Green, rect1);
483
graphics.DrawRectangle(
Pens
.Red, rect2);
487
graphics.DrawRectangles(
Pens
.Yellow, region1.GetRegionScans(matrix));
System.Windows.Forms (9)
System\Windows\Forms\Printing\PrintPreviewControl.cs (2)
686
g.DrawRectangle(
Pens
.Black, box);
700
g.DrawRectangle(
Pens
.Black, box);
System\Windows\Forms\Rendering\ControlPaint.cs (7)
1278
Pen pen =
Pens
.Black;
1488
? s_grabPenPrimary ??=
Pens
.Black
1489
: s_grabPenSecondary ??=
Pens
.White;
1687
Pen pen = primary ?
Pens
.White :
Pens
.Black;
1693
pen = primary ?
Pens
.Black :
Pens
.White;
System.Windows.Forms.Primitives (17)
System\Windows\Forms\GdiPlus\GdiPlusCache.cs (17)
108
KnownColor.Black =>
Pens
.Black,
109
KnownColor.White =>
Pens
.White,
110
KnownColor.Gray =>
Pens
.Gray,
111
KnownColor.Red =>
Pens
.Red,
112
KnownColor.Green =>
Pens
.Green,
113
KnownColor.Blue =>
Pens
.Blue,
114
KnownColor.Yellow =>
Pens
.Yellow,
115
KnownColor.Brown =>
Pens
.Brown,
116
KnownColor.LightGray =>
Pens
.LightGray,
117
KnownColor.LightGreen =>
Pens
.LightGreen,
118
KnownColor.LightBlue =>
Pens
.LightBlue,
119
KnownColor.LightYellow =>
Pens
.LightYellow,
120
KnownColor.DarkGray =>
Pens
.DarkGray,
121
KnownColor.DarkRed =>
Pens
.DarkRed,
122
KnownColor.DarkGreen =>
Pens
.DarkGreen,
123
KnownColor.DarkBlue =>
Pens
.DarkBlue,
124
KnownColor.Transparent =>
Pens
.Transparent,
System.Windows.Forms.Primitives.Tests (3)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (3)
87
g.DrawLine(
Pens
.DarkBlue, default, default);
206
g.DrawLine(
Pens
.DarkBlue, default, default);
280
g.DrawLine(
Pens
.DarkBlue, default, default);