221 instantiations of Pen
PresentationUI (1)
MS\Internal\Documents\DialogDivider.cs (1)
73new Pen(new SolidBrush(System.Drawing.SystemColors.ControlDark)),
System.Drawing.Common (3)
System\Drawing\Pen.cs (1)
93return new Pen(clonedPen);
System\Drawing\Pens.cs (1)
318Pen newPen = new(color, true);
System\Drawing\SystemPens.cs (1)
76return systemPens[idx] ??= new Pen(c, true);
System.Drawing.Common.Tests (178)
mono\System.Drawing.Imaging\BmpCodecTests.cs (1)
432using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
186using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\IconCodecTests.cs (1)
1870using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\JpegCodecTests.cs (1)
351using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\PngCodecTests.cs (1)
572using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
243using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing\GraphicsTests.cs (5)
834using Pen pen = new(Color.Red); 849using Pen pen = new(Color.Red); 1218using Pen pen = new(Color.Blue, width); 1381using Pen pen = new(Color.Blue, width); 1527using Pen pen = new(Color.Blue, width);
System\Drawing\Drawing2D\GraphicsPathTests.cs (7)
1661using Pen pen = new(Color.Blue); 1674using Pen pen = new(Color.Blue); 1693using Pen pen = new(Color.Blue); 1704using Pen pen = new(Color.Blue); 1726using Pen pen = new(Color.Aqua, 0); 2243using Pen pen = new(Color.Red, 3.0f); 2270using Pen pen = new(Color.Red, 3.0f);
System\Drawing\Graphics_DrawBezierTests.cs (11)
12using Pen pen = new(Color.White); 26using Pen pen = new(Color.Red); 45using Pen pen = new(Color.Red); 75Pen pen = new(Color.Red); 88using Pen pen = new(Color.Red); 106using Pen pen = new(Color.Red); 130Pen pen = new(Color.Red); 142using Pen pen = new(Color.Red); 152using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red); 179using Pen pen = new(Color.Red);
System\Drawing\Graphics_DrawLineTests.cs (10)
12using Pen pen = new(Color.White); 27using Pen pen = new(Color.White); 54Pen pen = new(Color.Red); 68using Pen pen = new(Color.Red); 87using Pen pen = new(Color.Red); 111Pen pen = new(Color.Red); 123using Pen pen = new(Color.Red); 135using Pen pen = new(Color.Red); 145using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red);
System\Drawing\GraphicsTests.Core.cs (3)
85Pen pen = new(Color.Red); 98using Pen pen = new(Color.Red); 115using Pen pen = new(Color.Red);
System\Drawing\GraphicsTests.cs (44)
1971Pen pen = new(Color.Red); 1985using Pen pen = new(Color.Red); 1997using Pen pen = new(Color.Red); 2009using Pen pen = new(Color.Red); 2028using Pen pen = new(Color.Red); 2053Pen pen = new(Color.Red); 2066using Pen pen = new(Color.Red); 2084using Pen pen = new(Color.Red); 2107Pen pen = new(Color.Red); 2119using Pen pen = new(Color.Red); 2129using Pen pen = new(Color.Red); 2139using Pen pen = new(Color.Red); 2156using Pen pen = new(Color.Red); 2180Pen pen = new(Color.Red); 2194using Pen pen = new(Color.Red); 2213using Pen pen = new(Color.Red); 2239Pen pen = new(Color.Red); 2253using Pen pen = new(Color.Red); 2265using Pen pen = new(Color.Red); 2277using Pen pen = new(Color.Red); 2296using Pen pen = new(Color.Red); 2320Pen pen = new(Color.Red); 2332using Pen pen = new(Color.Red); 2344using Pen pen = new(Color.Red); 2354using Pen pen = new(Color.Red); 2371using Pen pen = new(Color.Red); 2394Pen pen = new(Color.Red); 2405using Pen pen = new(Color.Red); 2414using Pen pen = new(Color.Red); 2426using Pen pen = new(Color.Red); 2443using Pen pen = new(Color.Red); 2470Pen pen = new(Color.Red); 2487using Pen pen = new(Color.Red); 2504using Pen pen = new(Color.Red); 2524using Pen pen = new(Color.Red); 2535using Pen pen = new(Color.Red); 2557using Pen pen = new(Color.Red); 2586Pen pen = new(Color.Red); 2600using Pen pen = new(Color.Red); 2615using Pen pen = new(Color.Red); 2627using Pen pen = new(Color.Red); 2646using Pen pen = new(Color.Red); 2756using Pen pen = new(Color.Red); 2772using Pen pen = new(Color.Red);
System\Drawing\Imaging\ImageAttributesTests.cs (3)
173using Pen pen = new(brush); 204using Pen pen = new(brush); 300using Pen pen = new(brush);
System\Drawing\PenTests.cs (89)
25using (Pen pen = new(brush)) 58using (Pen pen = new(brush, width)) 68using Pen pen = new(brush); 77AssertExtensions.Throws<ArgumentNullException>("brush", () => new Pen(null)); 78AssertExtensions.Throws<ArgumentNullException>("brush", () => new Pen(null, 0)); 87AssertExtensions.Throws<ArgumentException>(null, () => new Pen(brush)); 88AssertExtensions.Throws<ArgumentException>(null, () => new Pen(brush, 10)); 94using Pen pen = new(Color.Red); 109using Pen pen = new(Color.Red, width); 123using Pen pen = new(brush); 134using Pen pen = new(brush); 142Pen pen = new(brush); 153using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red); 175using Pen pen = new(brush); 183using Pen pen = new(brush); 192Pen pen = new(brush); 202yield return new object[] { new Pen(brush) }; 228Pen pen = new(brush); 238using Pen pen = new(brush); 246using Pen pen = new(brush); 254using Pen pen = new(brush); 269using (Pen pen = new(brush)) 282Pen pen = new(Color.Red); 297Pen pen = new(brush); 311using Pen pen = new(brush); 324using Pen pen = new(brush); 332using Pen pen = new(brush); 348using Pen pen = new(brush); 356Pen pen = new(brush); 367using Pen pen = new(brush); 384using Pen pen = new(brush); 392using Pen pen = new(brush); 408Pen pen = new(brush); 419using Pen pen = new(brush); 436using Pen pen = new(brush); 444using Pen pen = new(brush); 460Pen pen = new(brush); 474using Pen pen = new(brush); 486using Pen pen = new(brush); 494Pen pen = new(brush); 511using Pen pen = new(brush); 520Pen pen = new(brush); 535using Pen pen = new(brush); 549using Pen pen = new(brush); 557using Pen pen = new(brush); 569using Pen pen = new(brush); 577Pen pen = new(brush); 594using Pen pen = new(brush); 612using Pen pen = new(brush); 626using Pen pen = new(brush); 634Pen pen = new(brush); 661using Pen pen = new(brush); 680using Pen pen = new(brush); 688Pen pen = new(brush); 703using Pen pen = new(brush); 714using Pen pen = new(brush); 722Pen pen = new(brush); 739using Pen pen = new(brush); 748Pen pen = new(brush); 770using Pen pen = new(brush); 796using Pen pen = new(brush); 805using Pen pen = new(brush); 815using Pen pen = new(brush); 834using Pen pen = new(brush); 848Pen pen = new(brush); 859using Pen pen = new(brush); 875Pen pen = new(brush); 899using (Pen pen = new(brush)) 923using Pen pen = new(brush); 932Pen pen = new(brush); 959using (Pen pen = new(brush)) 983using Pen pen = new(brush); 992Pen pen = new(brush); 1006using Pen pen = new(brush); 1023Pen pen = new(brush); 1034using Pen pen = new(brush); 1044using Pen pen = new(brush); 1052Pen pen = new(brush); 1063using Pen pen = new(brush); 1078using Pen pen = new(brush); 1086using Pen pen = new(brush); 1095using Pen pen = new(brush); 1107Pen pen = new(brush); 1134using (Pen pen = new(brush)) 1158using Pen pen = new(brush); 1167Pen pen = new(brush); 1184using Pen pen = new(brush); 1193Pen pen = new(brush);
System.Windows.Forms (10)
System\Windows\Forms\Control.cs (1)
8149using Pen pen = new(Color.Red, width: 2);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
515using Pen pen = new(SystemColors.ControlDark, 1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStripButton.cs (2)
49Pen focusPen1 = new(SystemColors.ControlText, penWidth) 54Pen focusPen2 = new(SystemColors.Control, penWidth)
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (3)
292using Pen p = new(SystemColors.ButtonShadow) 468Pen focusPen1 = new(SystemColors.ControlText, penWidth) 473Pen focusPen2 = new(SystemColors.Control, penWidth)
System\Windows\Forms\Controls\ToolStrips\ToolStripProfessionalLowResolutionRenderer.cs (1)
57using Pen p = new(SystemColors.ButtonShadow)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
1025using Pen p = new(ColorTable.StatusStripBorder);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
1664using Pen pen = new(SystemColors.WindowFrame, 1);
System.Windows.Forms.Design (22)
System\ComponentModel\Design\ByteViewer.cs (1)
151using Pen pen = new(SystemColors.ControlDark);
System\ComponentModel\Design\DesignerActionPanel.cs (1)
486using (Pen borderPen = new(BorderColor))
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
105using Pen p = new(ActionPanel.BorderColor);
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
28using Pen p = new(ActionPanel.SeparatorColor);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (3)
29private readonly Pen _baselinePen = new(Color.Fuchsia); 169_edgePen = new Pen(snaplinesColor); 176_baselinePen = new Pen(snaplinesTextBaselineColor);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2293using (Pen pen = new(Color.Red, penThickness))
System\Windows\Forms\Design\DesignerUtils.cs (1)
123g.DrawRectangle(new Pen(SystemColors.ControlDarkDark), 0, 0, s_boxImageSize - 1, s_boxImageSize - 1);
System\Windows\Forms\Design\PanelDesigner.cs (1)
76Pen pen = new(penColor)
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
48Pen pen = new(penColor)
System\Windows\Forms\Design\SplitterDesigner.cs (1)
33using Pen pen = new(penColor);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
150using Pen pen = new(penColor) 168using Pen pen = new(control.BackColor)
System\Windows\Forms\Design\TabOrder.cs (1)
58_highlightPen = new Pen(SystemColors.Highlight);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
917using Pen p = new(new SolidBrush(Color.Black));
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (1)
50Pen pen = new(penColor)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (5)
1833Pen selectborderPen = new(_toolStripBorderColor); 1849Pen borderPen = new(_defaultBorderColor); 1938using (Pen p = new(_toolStripBorderColor)) 1985selectborderPen = new Pen(_selectedBorderColor); 1990selectborderPen = new Pen(_defaultBorderColor);
System.Windows.Forms.Primitives (6)
System\Windows\Forms\GdiPlus\GdiPlusCache.cs (1)
77=> width == 1 ? GetPenScope(color) : new PenCache.Scope(new Pen(color, width));
System\Windows\Forms\GdiPlus\PenCache.cs (1)
18public PenCacheEntry(Color color, bool cached) : base(color, cached) => _pen = new Pen(color);
System\Windows\Forms\SystemDrawingExtensions.cs (4)
101: new Pen(color); 105? new Pen(Color.FromArgb(color.ToArgb())) { DashStyle = dashStyle } 106: new Pen(color) { DashStyle = dashStyle }; 113=> new(brush, width);
WinFormsControlsTest (1)
CustomComCtl32Button.cs (1)
95Pen pen = new(SystemColors.ControlDarkDark, 1);
600 references to Pen
System.Drawing (1)
System.Drawing.cs (1)
103[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Pen))]
System.Drawing.Common (338)
System\Drawing\DashCap.cs (1)
7/// Specifies the available dash cap styles with which a <see cref='Pen'/> can end a line.
System\Drawing\Drawing2D\GraphicsPath.cs (12)
272public bool IsOutlineVisible(float x, float y, Pen pen) => IsOutlineVisible(new PointF(x, y), pen, null); 274public bool IsOutlineVisible(PointF point, Pen pen) => IsOutlineVisible(point, pen, null); 276public bool IsOutlineVisible(float x, float y, Pen pen, Graphics? graphics) 293public bool IsOutlineVisible(PointF pt, Pen pen, Graphics? graphics) => IsOutlineVisible(pt.X, pt.Y, pen, graphics); 295public bool IsOutlineVisible(int x, int y, Pen pen) => IsOutlineVisible(new Point(x, y), pen, null); 297public bool IsOutlineVisible(Point point, Pen pen) => IsOutlineVisible(point, pen, null); 299public bool IsOutlineVisible(int x, int y, Pen pen, Graphics? graphics) => IsOutlineVisible((float)x, y, pen, graphics); 301public bool IsOutlineVisible(Point pt, Pen pen, Graphics? graphics) => IsOutlineVisible((PointF)pt, pen, graphics); 820public RectangleF GetBounds(Matrix? matrix, Pen? pen) 845public void Widen(Pen pen) => Widen(pen, null, Flatness); 847public void Widen(Pen pen, Matrix? matrix) => Widen(pen, matrix, Flatness); 849public void Widen(Pen pen, Matrix? matrix, float flatness)
System\Drawing\Graphics.cs (103)
649public void DrawArc(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) 666public void DrawArc(Pen pen, RectangleF rect, float startAngle, float sweepAngle) => 672public void DrawArc(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) 678public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle) => 684public void DrawBezier(Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) 699public void DrawBezier(Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4) => 705public void DrawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4) => 713public void DrawRectangle(Pen pen, RectangleF rect) => DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); 718public void DrawRectangle(Pen pen, Rectangle rect) => DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); 721/// <inheritdoc cref="DrawRoundedRectangle(Pen, RectangleF, SizeF)"/> 722public void DrawRoundedRectangle(Pen pen, Rectangle rect, Size radius) => 728/// <param name="pen">The <see cref="Pen"/> to draw the outline with.</param> 731public void DrawRoundedRectangle(Pen pen, RectangleF rect, SizeF radius) 742public void DrawRectangle(Pen pen, float x, float y, float width, float height) 752public void DrawRectangle(Pen pen, int x, int y, int width, int height) 755/// <inheritdoc cref="DrawRectangles(Pen, Rectangle[])"/> 756public void DrawRectangles(Pen pen, params RectangleF[] rects) => DrawRectangles(pen, rects.OrThrowIfNull().AsSpan()); 758/// <inheritdoc cref="DrawRectangles(Pen, Rectangle[])"/> 764void DrawRectangles(Pen pen, params ReadOnlySpan<RectangleF> rects) 779/// <param name="pen"><see cref="Pen"/> that determines the color, width, and style of the outlines of the rectangles.</param> 781public void DrawRectangles(Pen pen, params Rectangle[] rects) => DrawRectangles(pen, rects.OrThrowIfNull().AsSpan()); 783/// <inheritdoc cref="DrawRectangles(Pen, Rectangle[])"/> 789void DrawRectangles(Pen pen, params ReadOnlySpan<Rectangle> rects) 804public void DrawEllipse(Pen pen, RectangleF rect) => DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height); 809public void DrawEllipse(Pen pen, float x, float y, float width, float height) 819public void DrawEllipse(Pen pen, Rectangle rect) => DrawEllipse(pen, (float)rect.X, rect.Y, rect.Width, rect.Height); 824public void DrawEllipse(Pen pen, int x, int y, int width, int height) => DrawEllipse(pen, (float)x, y, width, height); 829public void DrawPie(Pen pen, RectangleF rect, float startAngle, float sweepAngle) => 835public void DrawPie(Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) 845public void DrawPie(Pen pen, Rectangle rect, float startAngle, float sweepAngle) => 851public void DrawPie(Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) => 854/// <inheritdoc cref="DrawPolygon(Pen, Point[])"/> 855public void DrawPolygon(Pen pen, params PointF[] points) => DrawPolygon(pen, points.OrThrowIfNull().AsSpan()); 857/// <inheritdoc cref="DrawPolygon(Pen, Point[])"/> 863void DrawPolygon(Pen pen, params ReadOnlySpan<PointF> points) 878/// <param name="pen">The <see cref="Pen"/> to draw the outline with.</param> 880public void DrawPolygon(Pen pen, params Point[] points) => DrawPolygon(pen, points.OrThrowIfNull().AsSpan()); 882/// <inheritdoc cref="DrawPolygon(Pen, Point[])"/> 888void DrawPolygon(Pen pen, params ReadOnlySpan<Point> points) 903public void DrawPath(Pen pen, GraphicsPath path) 914/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 915public void DrawCurve(Pen pen, params PointF[] points) => DrawCurve(pen, points.OrThrowIfNull().AsSpan()); 917/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 923void DrawCurve(Pen pen, params ReadOnlySpan<PointF> points) 935/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 936public void DrawCurve(Pen pen, PointF[] points, float tension) => 939/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 945void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, float tension) 961/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 962public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments) => 966/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 967public void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments) => 971/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 972public void DrawCurve(Pen pen, PointF[] points, int offset, int numberOfSegments, float tension) => 975/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 981void DrawCurve(Pen pen, ReadOnlySpan<PointF> points, int offset, int numberOfSegments, float tension) 999/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 1000public void DrawCurve(Pen pen, params Point[] points) => DrawCurve(pen, points.OrThrowIfNull().AsSpan()); 1002/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 1008void DrawCurve(Pen pen, params ReadOnlySpan<Point> points) 1020/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 1021public void DrawCurve(Pen pen, Point[] points, float tension) => 1024/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 1030void DrawCurve(Pen pen, ReadOnlySpan<Point> points, float tension) 1049/// <param name="pen">The <see cref="Pen"/> to draw the curve with.</param> 1054public void DrawCurve(Pen pen, Point[] points, int offset, int numberOfSegments, float tension) => 1057/// <inheritdoc cref="DrawCurve(Pen, Point[], int, int, float)"/> 1063void DrawCurve(Pen pen, ReadOnlySpan<Point> points, int offset, int numberOfSegments, float tension) 1081/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1082public void DrawClosedCurve(Pen pen, params PointF[] points) => 1085/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1091void DrawClosedCurve(Pen pen, params ReadOnlySpan<PointF> points) 1109/// <param name="pen">The <see cref="Pen"/> to draw the closed curve with.</param> 1113public void DrawClosedCurve(Pen pen, PointF[] points, float tension, FillMode fillmode) => 1116/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1122void DrawClosedCurve(Pen pen, ReadOnlySpan<PointF> points, float tension, FillMode fillmode) 1138/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1139public void DrawClosedCurve(Pen pen, params Point[] points) => DrawClosedCurve(pen, points.OrThrowIfNull().AsSpan()); 1141/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1147void DrawClosedCurve(Pen pen, params ReadOnlySpan<Point> points) 1162/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1164public void DrawClosedCurve(Pen pen, Point[] points, float tension, FillMode fillmode) => 1167/// <inheritdoc cref="DrawClosedCurve(Pen, PointF[], float, FillMode)"/> 1173void DrawClosedCurve(Pen pen, ReadOnlySpan<Point> points, float tension, FillMode fillmode) 2360public void DrawLine(Pen pen, PointF pt1, PointF pt2) => DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); 2362/// <inheritdoc cref="DrawLines(Pen, Point[])"/> 2363public void DrawLines(Pen pen, params PointF[] points) => DrawLines(pen, points.OrThrowIfNull().AsSpan()); 2365/// <inheritdoc cref="DrawLines(Pen, Point[])"/> 2371void DrawLines(Pen pen, params ReadOnlySpan<PointF> points) 2386public void DrawLine(Pen pen, int x1, int y1, int x2, int y2) => 2392public void DrawLine(Pen pen, Point pt1, Point pt2) => DrawLine(pen, (float)pt1.X, pt1.Y, pt2.X, pt2.Y); 2397/// <param name="pen">The <see cref="Pen"/> that determines the color, width, and style of the line segments.</param> 2399public void DrawLines(Pen pen, params Point[] points) 2412/// <inheritdoc cref="DrawLines(Pen, Point[])"/> 2418void DrawLines(Pen pen, params ReadOnlySpan<Point> points) 2781public void DrawLine(Pen pen, float x1, float y1, float x2, float y2) 2788/// <inheritdoc cref="DrawBeziers(Pen, Point[])"/> 2789public void DrawBeziers(Pen pen, params PointF[] points) => 2792/// <inheritdoc cref="DrawBeziers(Pen, Point[])"/> 2798void DrawBeziers(Pen pen, params ReadOnlySpan<PointF> points) 2821public void DrawBeziers(Pen pen, params Point[] points) => DrawBeziers(pen, points.OrThrowIfNull().AsSpan()); 2823/// <inheritdoc cref="DrawBeziers(Pen, Point[])"/> 2829void DrawBeziers(Pen pen, params ReadOnlySpan<Point> points)
System\Drawing\Imaging\ColorAdjustType.cs (1)
28/// Defines color adjustment information for <see cref='Drawing.Pen'/> objects.
System\Drawing\Pen.cs (40)
40/// Initializes a new instance of the <see cref='Pen'/> class with the specified 65/// Initializes a new instance of the <see cref='Pen'/> class with the specified <see cref='Drawing.Brush'/> and width. 86/// Creates an exact copy of this <see cref='Pen'/>. 97/// Cleans up Windows resources for this <see cref='Pen'/>. 116throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 128/// Cleans up Windows resources for this <see cref='Pen'/>. 133/// Gets or sets the width of this <see cref='Pen'/>. 148throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 157/// Sets the values that determine the style of cap used to end lines drawn by this <see cref='Pen'/>. 163throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 176/// Gets or sets the cap style used at the beginning of lines drawn with this <see cref='Pen'/>. 209throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 218/// Gets or sets the cap style used at the end of lines drawn with this <see cref='Pen'/>. 251throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 260/// Gets or sets a custom cap style to use at the beginning of lines drawn with this <see cref='Pen'/>. 275throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 285/// Gets or sets a custom cap style to use at the end of lines drawn with this <see cref='Pen'/>. 300throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 310/// Gets or sets the cap style used at the beginning or end of dashed lines drawn with this <see cref='Pen'/>. 330throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 339/// Gets or sets the join style for the ends of two overlapping lines drawn with this <see cref='Pen'/>. 359throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 383throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 392/// Gets or sets the alignment for objects drawn with this <see cref='Pen'/>. 412throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 421/// Gets or sets the geometrical transform for objects drawn with this <see cref='Pen'/>. 436throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 448/// Resets the geometric transform for this <see cref='Pen'/> to identity. 457/// Multiplies the transform matrix for this <see cref='Pen'/> by the specified <see cref='Matrix'/>. 462/// Multiplies the transform matrix for this <see cref='Pen'/> by the specified <see cref='Matrix'/> in the specified order. 530/// Gets the style of lines drawn with this <see cref='Pen'/>. 544/// Gets or sets the color of this <see cref='Pen'/>. 570throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 590/// Gets or sets the <see cref='Drawing.Brush'/> that determines attributes of this <see cref='Pen'/>. 630throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 648/// Gets or sets the style used for dashed lines drawn with this <see cref='Pen'/>. 668throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 721throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 774throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen))); 817throw new ArgumentException(SR.Format(SR.CantChangeImmutableObjects, nameof(Pen)));
System\Drawing\Pens.cs (144)
149public static Pen Transparent => GetPen(s_transparentKey, Color.Transparent); 151public static Pen AliceBlue => GetPen(s_aliceBlueKey, Color.AliceBlue); 152public static Pen AntiqueWhite => GetPen(s_antiqueWhiteKey, Color.AntiqueWhite); 153public static Pen Aqua => GetPen(s_aquaKey, Color.Aqua); 154public static Pen Aquamarine => GetPen(s_aquamarineKey, Color.Aquamarine); 155public static Pen Azure => GetPen(s_azureKey, Color.Azure); 157public static Pen Beige => GetPen(s_beigeKey, Color.Beige); 158public static Pen Bisque => GetPen(s_bisqueKey, Color.Bisque); 159public static Pen Black => GetPen(s_blackKey, Color.Black); 160public static Pen BlanchedAlmond => GetPen(s_blanchedAlmondKey, Color.BlanchedAlmond); 161public static Pen Blue => GetPen(s_blueKey, Color.Blue); 162public static Pen BlueViolet => GetPen(s_blueVioletKey, Color.BlueViolet); 163public static Pen Brown => GetPen(s_brownKey, Color.Brown); 164public static Pen BurlyWood => GetPen(s_burlyWoodKey, Color.BurlyWood); 166public static Pen CadetBlue => GetPen(s_cadetBlueKey, Color.CadetBlue); 167public static Pen Chartreuse => GetPen(s_chartreuseKey, Color.Chartreuse); 168public static Pen Chocolate => GetPen(s_chocolateKey, Color.Chocolate); 169public static Pen Coral => GetPen(s_coralKey, Color.Coral); 170public static Pen CornflowerBlue => GetPen(s_cornflowerBlueKey, Color.CornflowerBlue); 171public static Pen Cornsilk => GetPen(s_cornsilkKey, Color.Cornsilk); 172public static Pen Crimson => GetPen(s_crimsonKey, Color.Crimson); 173public static Pen Cyan => GetPen(s_cyanKey, Color.Cyan); 175public static Pen DarkBlue => GetPen(s_darkBlueKey, Color.DarkBlue); 176public static Pen DarkCyan => GetPen(s_darkCyanKey, Color.DarkCyan); 177public static Pen DarkGoldenrod => GetPen(s_darkGoldenrodKey, Color.DarkGoldenrod); 178public static Pen DarkGray => GetPen(s_darkGrayKey, Color.DarkGray); 179public static Pen DarkGreen => GetPen(s_darkGreenKey, Color.DarkGreen); 180public static Pen DarkKhaki => GetPen(s_darkKhakiKey, Color.DarkKhaki); 181public static Pen DarkMagenta => GetPen(s_darkMagentaKey, Color.DarkMagenta); 182public static Pen DarkOliveGreen => GetPen(s_darkOliveGreenKey, Color.DarkOliveGreen); 183public static Pen DarkOrange => GetPen(s_darkOrangeKey, Color.DarkOrange); 184public static Pen DarkOrchid => GetPen(s_darkOrchidKey, Color.DarkOrchid); 185public static Pen DarkRed => GetPen(s_darkRedKey, Color.DarkRed); 186public static Pen DarkSalmon => GetPen(s_darkSalmonKey, Color.DarkSalmon); 187public static Pen DarkSeaGreen => GetPen(s_darkSeaGreenKey, Color.DarkSeaGreen); 188public static Pen DarkSlateBlue => GetPen(s_darkSlateBlueKey, Color.DarkSlateBlue); 189public static Pen DarkSlateGray => GetPen(s_darkSlateGrayKey, Color.DarkSlateGray); 190public static Pen DarkTurquoise => GetPen(s_darkTurquoiseKey, Color.DarkTurquoise); 191public static Pen DarkViolet => GetPen(s_darkVioletKey, Color.DarkViolet); 192public static Pen DeepPink => GetPen(s_deepPinkKey, Color.DeepPink); 193public static Pen DeepSkyBlue => GetPen(s_deepSkyBlueKey, Color.DeepSkyBlue); 194public static Pen DimGray => GetPen(s_dimGrayKey, Color.DimGray); 195public static Pen DodgerBlue => GetPen(s_dodgerBlueKey, Color.DodgerBlue); 197public static Pen Firebrick => GetPen(s_firebrickKey, Color.Firebrick); 198public static Pen FloralWhite => GetPen(s_floralWhiteKey, Color.FloralWhite); 199public static Pen ForestGreen => GetPen(s_forestGreenKey, Color.ForestGreen); 200public static Pen Fuchsia => GetPen(s_fuchsiaKey, Color.Fuchsia); 202public static Pen Gainsboro => GetPen(s_gainsboroKey, Color.Gainsboro); 203public static Pen GhostWhite => GetPen(s_ghostWhiteKey, Color.GhostWhite); 204public static Pen Gold => GetPen(s_goldKey, Color.Gold); 205public static Pen Goldenrod => GetPen(s_goldenrodKey, Color.Goldenrod); 206public static Pen Gray => GetPen(s_grayKey, Color.Gray); 207public static Pen Green => GetPen(s_greenKey, Color.Green); 208public static Pen GreenYellow => GetPen(s_greenYellowKey, Color.GreenYellow); 210public static Pen Honeydew => GetPen(s_honeydewKey, Color.Honeydew); 211public static Pen HotPink => GetPen(s_hotPinkKey, Color.HotPink); 213public static Pen IndianRed => GetPen(s_indianRedKey, Color.IndianRed); 214public static Pen Indigo => GetPen(s_indigoKey, Color.Indigo); 215public static Pen Ivory => GetPen(s_ivoryKey, Color.Ivory); 217public static Pen Khaki => GetPen(s_khakiKey, Color.Khaki); 219public static Pen Lavender => GetPen(s_lavenderKey, Color.Lavender); 220public static Pen LavenderBlush => GetPen(s_lavenderBlushKey, Color.LavenderBlush); 221public static Pen LawnGreen => GetPen(s_lawnGreenKey, Color.LawnGreen); 222public static Pen LemonChiffon => GetPen(s_lemonChiffonKey, Color.LemonChiffon); 223public static Pen LightBlue => GetPen(s_lightBlueKey, Color.LightBlue); 224public static Pen LightCoral => GetPen(s_lightCoralKey, Color.LightCoral); 225public static Pen LightCyan => GetPen(s_lightCyanKey, Color.LightCyan); 226public static Pen LightGoldenrodYellow => GetPen(s_lightGoldenrodYellowKey, Color.LightGoldenrodYellow); 227public static Pen LightGreen => GetPen(s_lightGreenKey, Color.LightGreen); 228public static Pen LightGray => GetPen(s_lightGrayKey, Color.LightGray); 229public static Pen LightPink => GetPen(s_lightPinkKey, Color.LightPink); 230public static Pen LightSalmon => GetPen(s_lightSalmonKey, Color.LightSalmon); 231public static Pen LightSeaGreen => GetPen(s_lightSeaGreenKey, Color.LightSeaGreen); 232public static Pen LightSkyBlue => GetPen(s_lightSkyBlueKey, Color.LightSkyBlue); 233public static Pen LightSlateGray => GetPen(s_lightSlateGrayKey, Color.LightSlateGray); 234public static Pen LightSteelBlue => GetPen(s_lightSteelBlueKey, Color.LightSteelBlue); 235public static Pen LightYellow => GetPen(s_lightYellowKey, Color.LightYellow); 236public static Pen Lime => GetPen(s_limeKey, Color.Lime); 237public static Pen LimeGreen => GetPen(s_limeGreenKey, Color.LimeGreen); 238public static Pen Linen => GetPen(s_linenKey, Color.Linen); 240public static Pen Magenta => GetPen(s_magentaKey, Color.Magenta); 241public static Pen Maroon => GetPen(s_maroonKey, Color.Maroon); 242public static Pen MediumAquamarine => GetPen(s_mediumAquamarineKey, Color.MediumAquamarine); 243public static Pen MediumBlue => GetPen(s_mediumBlueKey, Color.MediumBlue); 244public static Pen MediumOrchid => GetPen(s_mediumOrchidKey, Color.MediumOrchid); 245public static Pen MediumPurple => GetPen(s_mediumPurpleKey, Color.MediumPurple); 246public static Pen MediumSeaGreen => GetPen(s_mediumSeaGreenKey, Color.MediumSeaGreen); 247public static Pen MediumSlateBlue => GetPen(s_mediumSlateBlueKey, Color.MediumSlateBlue); 248public static Pen MediumSpringGreen => GetPen(s_mediumSpringGreenKey, Color.MediumSpringGreen); 249public static Pen MediumTurquoise => GetPen(s_mediumTurquoiseKey, Color.MediumTurquoise); 250public static Pen MediumVioletRed => GetPen(s_mediumVioletRedKey, Color.MediumVioletRed); 251public static Pen MidnightBlue => GetPen(s_midnightBlueKey, Color.MidnightBlue); 252public static Pen MintCream => GetPen(s_mintCreamKey, Color.MintCream); 253public static Pen MistyRose => GetPen(s_mistyRoseKey, Color.MistyRose); 254public static Pen Moccasin => GetPen(s_moccasinKey, Color.Moccasin); 256public static Pen NavajoWhite => GetPen(s_navajoWhiteKey, Color.NavajoWhite); 257public static Pen Navy => GetPen(s_navyKey, Color.Navy); 259public static Pen OldLace => GetPen(s_oldLaceKey, Color.OldLace); 260public static Pen Olive => GetPen(s_oliveKey, Color.Olive); 261public static Pen OliveDrab => GetPen(s_oliveDrabKey, Color.OliveDrab); 262public static Pen Orange => GetPen(s_orangeKey, Color.Orange); 263public static Pen OrangeRed => GetPen(s_orangeRedKey, Color.OrangeRed); 264public static Pen Orchid => GetPen(s_orchidKey, Color.Orchid); 266public static Pen PaleGoldenrod => GetPen(s_paleGoldenrodKey, Color.PaleGoldenrod); 267public static Pen PaleGreen => GetPen(s_paleGreenKey, Color.PaleGreen); 268public static Pen PaleTurquoise => GetPen(s_paleTurquoiseKey, Color.PaleTurquoise); 269public static Pen PaleVioletRed => GetPen(s_paleVioletRedKey, Color.PaleVioletRed); 270public static Pen PapayaWhip => GetPen(s_papayaWhipKey, Color.PapayaWhip); 271public static Pen PeachPuff => GetPen(s_peachPuffKey, Color.PeachPuff); 272public static Pen Peru => GetPen(s_peruKey, Color.Peru); 273public static Pen Pink => GetPen(s_pinkKey, Color.Pink); 274public static Pen Plum => GetPen(s_plumKey, Color.Plum); 275public static Pen PowderBlue => GetPen(s_powderBlueKey, Color.PowderBlue); 276public static Pen Purple => GetPen(s_purpleKey, Color.Purple); 278public static Pen Red => GetPen(s_redKey, Color.Red); 279public static Pen RosyBrown => GetPen(s_rosyBrownKey, Color.RosyBrown); 280public static Pen RoyalBlue => GetPen(s_royalBlueKey, Color.RoyalBlue); 282public static Pen SaddleBrown => GetPen(s_saddleBrownKey, Color.SaddleBrown); 283public static Pen Salmon => GetPen(s_salmonKey, Color.Salmon); 284public static Pen SandyBrown => GetPen(s_sandyBrownKey, Color.SandyBrown); 285public static Pen SeaGreen => GetPen(s_seaGreenKey, Color.SeaGreen); 286public static Pen SeaShell => GetPen(s_seaShellKey, Color.SeaShell); 287public static Pen Sienna => GetPen(s_siennaKey, Color.Sienna); 288public static Pen Silver => GetPen(s_silverKey, Color.Silver); 289public static Pen SkyBlue => GetPen(s_skyBlueKey, Color.SkyBlue); 290public static Pen SlateBlue => GetPen(s_slateBlueKey, Color.SlateBlue); 291public static Pen SlateGray => GetPen(s_slateGrayKey, Color.SlateGray); 292public static Pen Snow => GetPen(s_snowKey, Color.Snow); 293public static Pen SpringGreen => GetPen(s_springGreenKey, Color.SpringGreen); 294public static Pen SteelBlue => GetPen(s_steelBlueKey, Color.SteelBlue); 296public static Pen Tan => GetPen(s_tanKey, Color.Tan); 297public static Pen Teal => GetPen(s_tealKey, Color.Teal); 298public static Pen Thistle => GetPen(s_thistleKey, Color.Thistle); 299public static Pen Tomato => GetPen(s_tomatoKey, Color.Tomato); 300public static Pen Turquoise => GetPen(s_turquoiseKey, Color.Turquoise); 302public static Pen Violet => GetPen(s_violetKey, Color.Violet); 304public static Pen Wheat => GetPen(s_wheatKey, Color.Wheat); 305public static Pen White => GetPen(s_whiteKey, Color.White); 306public static Pen WhiteSmoke => GetPen(s_whiteSmokeKey, Color.WhiteSmoke); 308public static Pen Yellow => GetPen(s_yellowKey, Color.Yellow); 309public static Pen YellowGreen => GetPen(s_yellowGreenKey, Color.YellowGreen); 311private static Pen GetPen(object key, Color color) 313if (Gdip.ThreadData.TryGetValue(key, out object? objectPen) && objectPen is Pen Pen) 318Pen newPen = new(color, true);
System\Drawing\PointerExtensions.cs (1)
14public static GpPen* Pointer(this Pen? pen) => pen is null ? null : pen.NativePen;
System\Drawing\SystemPens.cs (36)
10public static Pen ActiveBorder => FromSystemColor(SystemColors.ActiveBorder); 11public static Pen ActiveCaption => FromSystemColor(SystemColors.ActiveCaption); 12public static Pen ActiveCaptionText => FromSystemColor(SystemColors.ActiveCaptionText); 13public static Pen AppWorkspace => FromSystemColor(SystemColors.AppWorkspace); 15public static Pen ButtonFace => FromSystemColor(SystemColors.ButtonFace); 16public static Pen ButtonHighlight => FromSystemColor(SystemColors.ButtonHighlight); 18public static Pen ButtonShadow => FromSystemColor(SystemColors.ButtonShadow); 20public static Pen Control => FromSystemColor(SystemColors.Control); 21public static Pen ControlText => FromSystemColor(SystemColors.ControlText); 22public static Pen ControlDark => FromSystemColor(SystemColors.ControlDark); 23public static Pen ControlDarkDark => FromSystemColor(SystemColors.ControlDarkDark); 24public static Pen ControlLight => FromSystemColor(SystemColors.ControlLight); 25public static Pen ControlLightLight => FromSystemColor(SystemColors.ControlLightLight); 27public static Pen Desktop => FromSystemColor(SystemColors.Desktop); 29public static Pen GradientActiveCaption => FromSystemColor(SystemColors.GradientActiveCaption); 30public static Pen GradientInactiveCaption => FromSystemColor(SystemColors.GradientInactiveCaption); 31public static Pen GrayText => FromSystemColor(SystemColors.GrayText); 33public static Pen Highlight => FromSystemColor(SystemColors.Highlight); 34public static Pen HighlightText => FromSystemColor(SystemColors.HighlightText); 35public static Pen HotTrack => FromSystemColor(SystemColors.HotTrack); 37public static Pen InactiveBorder => FromSystemColor(SystemColors.InactiveBorder); 38public static Pen InactiveCaption => FromSystemColor(SystemColors.InactiveCaption); 39public static Pen InactiveCaptionText => FromSystemColor(SystemColors.InactiveCaptionText); 40public static Pen Info => FromSystemColor(SystemColors.Info); 41public static Pen InfoText => FromSystemColor(SystemColors.InfoText); 43public static Pen Menu => FromSystemColor(SystemColors.Menu); 44public static Pen MenuBar => FromSystemColor(SystemColors.MenuBar); 45public static Pen MenuHighlight => FromSystemColor(SystemColors.MenuHighlight); 46public static Pen MenuText => FromSystemColor(SystemColors.MenuText); 48public static Pen ScrollBar => FromSystemColor(SystemColors.ScrollBar); 50public static Pen Window => FromSystemColor(SystemColors.Window); 51public static Pen WindowFrame => FromSystemColor(SystemColors.WindowFrame); 52public static Pen WindowText => FromSystemColor(SystemColors.WindowText); 54public static Pen FromSystemColor(Color c) 61if (!Gdip.ThreadData.TryGetValue(s_systemPensKey, out object? tempSystemPens) || tempSystemPens is not Pen[] systemPens) 63systemPens = new Pen[(int)KnownColor.WindowText + (int)KnownColor.MenuHighlight - (int)KnownColor.YellowGreen];
System.Drawing.Common.Tests (192)
mono\System.Drawing.Imaging\BmpCodecTests.cs (1)
432using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing.Imaging\GifCodecTests.cs (1)
186using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\IconCodecTests.cs (1)
1870using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\JpegCodecTests.cs (1)
351using (Pen p = new(Color.Red, 2))
mono\System.Drawing.Imaging\PngCodecTests.cs (1)
572using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing.Imaging\TiffCodecTests.cs (1)
243using (Pen p = new(Color.BlueViolet, 2))
mono\System.Drawing\GraphicsTests.cs (5)
834using Pen pen = new(Color.Red); 849using Pen pen = new(Color.Red); 1218using Pen pen = new(Color.Blue, width); 1381using Pen pen = new(Color.Blue, width); 1527using Pen pen = new(Color.Blue, width);
System\Drawing\Drawing2D\GraphicsPathTests.cs (7)
1661using Pen pen = new(Color.Blue); 1674using Pen pen = new(Color.Blue); 1693using Pen pen = new(Color.Blue); 1704using Pen pen = new(Color.Blue); 1726using Pen pen = new(Color.Aqua, 0); 2243using Pen pen = new(Color.Red, 3.0f); 2270using Pen pen = new(Color.Red, 3.0f);
System\Drawing\Graphics_DrawBezierTests.cs (11)
12using Pen pen = new(Color.White); 26using Pen pen = new(Color.Red); 45using Pen pen = new(Color.Red); 75Pen pen = new(Color.Red); 88using Pen pen = new(Color.Red); 106using Pen pen = new(Color.Red); 130Pen pen = new(Color.Red); 142using Pen pen = new(Color.Red); 152using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red); 179using Pen pen = new(Color.Red);
System\Drawing\Graphics_DrawLineTests.cs (10)
12using Pen pen = new(Color.White); 27using Pen pen = new(Color.White); 54Pen pen = new(Color.Red); 68using Pen pen = new(Color.Red); 87using Pen pen = new(Color.Red); 111Pen pen = new(Color.Red); 123using Pen pen = new(Color.Red); 135using Pen pen = new(Color.Red); 145using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red);
System\Drawing\GraphicsTests.Core.cs (3)
85Pen pen = new(Color.Red); 98using Pen pen = new(Color.Red); 115using Pen pen = new(Color.Red);
System\Drawing\GraphicsTests.cs (44)
1971Pen pen = new(Color.Red); 1985using Pen pen = new(Color.Red); 1997using Pen pen = new(Color.Red); 2009using Pen pen = new(Color.Red); 2028using Pen pen = new(Color.Red); 2053Pen pen = new(Color.Red); 2066using Pen pen = new(Color.Red); 2084using Pen pen = new(Color.Red); 2107Pen pen = new(Color.Red); 2119using Pen pen = new(Color.Red); 2129using Pen pen = new(Color.Red); 2139using Pen pen = new(Color.Red); 2156using Pen pen = new(Color.Red); 2180Pen pen = new(Color.Red); 2194using Pen pen = new(Color.Red); 2213using Pen pen = new(Color.Red); 2239Pen pen = new(Color.Red); 2253using Pen pen = new(Color.Red); 2265using Pen pen = new(Color.Red); 2277using Pen pen = new(Color.Red); 2296using Pen pen = new(Color.Red); 2320Pen pen = new(Color.Red); 2332using Pen pen = new(Color.Red); 2344using Pen pen = new(Color.Red); 2354using Pen pen = new(Color.Red); 2371using Pen pen = new(Color.Red); 2394Pen pen = new(Color.Red); 2405using Pen pen = new(Color.Red); 2414using Pen pen = new(Color.Red); 2426using Pen pen = new(Color.Red); 2443using Pen pen = new(Color.Red); 2470Pen pen = new(Color.Red); 2487using Pen pen = new(Color.Red); 2504using Pen pen = new(Color.Red); 2524using Pen pen = new(Color.Red); 2535using Pen pen = new(Color.Red); 2557using Pen pen = new(Color.Red); 2586Pen pen = new(Color.Red); 2600using Pen pen = new(Color.Red); 2615using Pen pen = new(Color.Red); 2627using Pen pen = new(Color.Red); 2646using Pen pen = new(Color.Red); 2756using Pen pen = new(Color.Red); 2772using Pen pen = new(Color.Red);
System\Drawing\Imaging\ImageAttributesTests.cs (3)
173using Pen pen = new(brush); 204using Pen pen = new(brush); 300using Pen pen = new(brush);
System\Drawing\PensTests.cs (3)
155public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 159public void Pens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor) 161Pen pen = getPen();
System\Drawing\PenTests.cs (97)
25using (Pen pen = new(brush)) 58using (Pen pen = new(brush, width)) 68using Pen pen = new(brush); 94using Pen pen = new(Color.Red); 109using Pen pen = new(Color.Red, width); 123using Pen pen = new(brush); 134using Pen pen = new(brush); 142Pen pen = new(brush); 153using Pen pen = new(Color.Red); 162using Pen pen = new(Color.Red); 175using Pen pen = new(brush); 183using Pen pen = new(brush); 192Pen pen = new(brush); 207public void Clone_Invoke_ReturnsExpected(Pen pen) 211Pen clone = Assert.IsType<Pen>(pen.Clone()); 228Pen pen = new(brush); 238using Pen pen = new(brush); 246using Pen pen = new(brush); 254using Pen pen = new(brush); 258private static void ValidateInitialPenColorState(Pen pen) 269using (Pen pen = new(brush)) 282Pen pen = new(Color.Red); 297Pen pen = new(brush); 311using Pen pen = new(brush); 324using Pen pen = new(brush); 332using Pen pen = new(brush); 348using Pen pen = new(brush); 356Pen pen = new(brush); 367using Pen pen = new(brush); 384using Pen pen = new(brush); 392using Pen pen = new(brush); 408Pen pen = new(brush); 419using Pen pen = new(brush); 436using Pen pen = new(brush); 444using Pen pen = new(brush); 460Pen pen = new(brush); 474using Pen pen = new(brush); 486using Pen pen = new(brush); 494Pen pen = new(brush); 511using Pen pen = new(brush); 520Pen pen = new(brush); 535using Pen pen = new(brush); 549using Pen pen = new(brush); 557using Pen pen = new(brush); 569using Pen pen = new(brush); 577Pen pen = new(brush); 594using Pen pen = new(brush); 612using Pen pen = new(brush); 626using Pen pen = new(brush); 634Pen pen = new(brush); 661using Pen pen = new(brush); 680using Pen pen = new(brush); 688Pen pen = new(brush); 703using Pen pen = new(brush); 714using Pen pen = new(brush); 722Pen pen = new(brush); 739using Pen pen = new(brush); 748Pen pen = new(brush); 770using Pen pen = new(brush); 777Pen clone = (Pen)pen.Clone(); 796using Pen pen = new(brush); 805using Pen pen = new(brush); 815using Pen pen = new(brush); 834using Pen pen = new(brush); 848Pen pen = new(brush); 859using Pen pen = new(brush); 875Pen pen = new(brush); 899using (Pen pen = new(brush)) 907Pen clone = (Pen)pen.Clone(); 923using Pen pen = new(brush); 932Pen pen = new(brush); 959using (Pen pen = new(brush)) 967Pen clone = (Pen)pen.Clone(); 983using Pen pen = new(brush); 992Pen pen = new(brush); 1006using Pen pen = new(brush); 1023Pen pen = new(brush); 1034using Pen pen = new(brush); 1044using Pen pen = new(brush); 1052Pen pen = new(brush); 1063using Pen pen = new(brush); 1078using Pen pen = new(brush); 1086using Pen pen = new(brush); 1095using Pen pen = new(brush); 1107Pen pen = new(brush); 1134using (Pen pen = new(brush)) 1142Pen clone = (Pen)pen.Clone(); 1158using Pen pen = new(brush); 1167Pen pen = new(brush); 1184using Pen pen = new(brush); 1193Pen pen = new(brush); 1200private static void VerifyPen<T>(Pen pen, PenType expectedPenType, float expectedWidth) where T : Brush
System\Drawing\SystemPensTest.cs (3)
47public static object[] Pen(Func<Pen> getPen, Color expectedColor) => [getPen, expectedColor]; 51public void SystemPens_Get_ReturnsExpected(Func<Pen> getPen, Color expectedColor) 53Pen pen = getPen();
System.Windows.Forms (28)
System\Windows\Forms\Control.cs (1)
8149using Pen pen = new(Color.Red, width: 2);
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (1)
118Pen innerPen = comboBox.Enabled ? borderPen : SystemPens.Control;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
2087Pen pen = SystemInformation.HighContrast ? SystemPens.ControlLight : SystemPens.Control;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
515using Pen pen = new(SystemColors.ControlDark, 1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStripButton.cs (2)
49Pen focusPen1 = new(SystemColors.ControlText, penWidth) 54Pen focusPen2 = new(SystemColors.Control, penWidth)
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (4)
292using Pen p = new(SystemColors.ButtonShadow) 347Pen foreColorPen = SystemPens.ButtonShadow; 468Pen focusPen1 = new(SystemColors.ControlText, penWidth) 473Pen focusPen2 = new(SystemColors.Control, penWidth)
System\Windows\Forms\Controls\ToolStrips\ToolStripProfessionalLowResolutionRenderer.cs (1)
57using Pen p = new(SystemColors.ButtonShadow)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (3)
1025using Pen p = new(ColorTable.StatusStripBorder); 1506Pen leftPen = (rightToLeft) ? highlightColorPen : foreColorPen; 1507Pen rightPen = (rightToLeft) ? foreColorPen : highlightColorPen;
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (3)
713Pen leftPen = (rightToLeft) ? SystemPens.ButtonHighlight : foreColorPen; 714Pen rightPen = (rightToLeft) ? foreColorPen : SystemPens.ButtonHighlight; 747Pen leftPen, topPen, rightPen, bottomPen;
System\Windows\Forms\Rendering\ControlPaint.cs (11)
22private static Pen? t_focusPen; // pen used to draw a focus rectangle 25private static Pen? t_focusPenInvert; // pen used to draw a focus rectangle 33private static Pen? s_grabPenPrimary; // pen used for primary grab handles 34private static Pen? s_grabPenSecondary; // pen used for secondary grab handles 1083Pen pen = SystemPens.ControlLight; 1275Pen pen = Pens.Black; 1385Pen pen = SystemPens.ControlDark; 1483Pen pen = primary 1664using Pen pen = new(SystemColors.WindowFrame, 1); 1683Pen pen = primary ? Pens.White : Pens.Black; 2125private static Pen GetFocusPen(Color baseColor, bool odds, bool highContrast, bool blackAndWhite)
System.Windows.Forms.Design (28)
System\ComponentModel\Design\ByteViewer.cs (1)
151using Pen pen = new(SystemColors.ControlDark);
System\ComponentModel\Design\DesignerActionPanel.cs (1)
486using (Pen borderPen = new(BorderColor))
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
105using Pen p = new(ActionPanel.BorderColor);
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
28using Pen p = new(ActionPanel.SeparatorColor);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (3)
27private readonly Pen _edgePen = SystemPens.Highlight; 29private readonly Pen _baselinePen = new(Color.Fuchsia); 819Pen currentPen;
System\Windows\Forms\Design\ControlDesigner.cs (1)
2293using (Pen pen = new(Color.Red, penThickness))
System\Windows\Forms\Design\DesignerUtils.cs (1)
190Pen pen = SystemPens.ControlDarkDark;
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (1)
439var pen = SystemPens.ControlText;
System\Windows\Forms\Design\PanelDesigner.cs (3)
36Pen pen = BorderPen; 66protected Pen BorderPen 76Pen pen = new(penColor)
System\Windows\Forms\Design\PictureBoxDesigner.cs (1)
48Pen pen = new(penColor)
System\Windows\Forms\Design\SplitterDesigner.cs (1)
33using Pen pen = new(penColor);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (2)
150using Pen pen = new(penColor) 168using Pen pen = new(control.BackColor)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
855using Pen pen = BorderPen;
System\Windows\Forms\Design\TabOrder.cs (2)
30private readonly Pen _highlightPen; 264Pen pen;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
917using Pen p = new(new SolidBrush(Color.Black));
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (3)
40private Pen BorderPen 50Pen pen = new(penColor) 239Pen pen = BorderPen;
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
1833Pen selectborderPen = new(_toolStripBorderColor); 1849Pen borderPen = new(_defaultBorderColor); 1938using (Pen p = new(_toolStripBorderColor)) 1981Pen selectborderPen;
System.Windows.Forms.Design.Tests (1)
System\Windows\Forms\Design\TabOrderTests.cs (1)
68((Pen)accessor._highlightPen).Color.Should().Be(SystemColors.Highlight);
System.Windows.Forms.Primitives (11)
System\Windows\Forms\GdiPlus\GdiPlusCache.cs (3)
31Pen? pen = color.IsSystemColor 62/// Returns a cached <see cref="Pen"/>. Use in a using and assign to var. 105private static Pen? PenFromKnownColor(KnownColor color) => color switch
System\Windows\Forms\GdiPlus\PenCache.cs (3)
8internal sealed class PenCache : RefCountedCache<Pen, Color, Color> 17private readonly Pen _pen; 19public override Pen Object => _pen;
System\Windows\Forms\RefCountedCache.cs (1)
12/// The target object the cache represents. If you're caching <see cref="Drawing.Pen"/> that would be the
System\Windows\Forms\SystemDrawingExtensions.cs (4)
54internal static void DrawLines(this Graphics graphics, Pen pen, ReadOnlySpan<int> lines) 91/// Creates a <see cref="Pen"/>. If <paramref name="color"/> is a system color, makes a static copy of the 94internal static Pen CreateStaticPen(this Color color, DashStyle dashStyle) 112internal static Pen CreateStaticPen(this Brush brush, float width = 1.0f)
WinFormsControlsTest (1)
CustomComCtl32Button.cs (1)
95Pen pen = new(SystemColors.ControlDarkDark, 1);