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