-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathPen.xml
More file actions
1863 lines (1692 loc) · 113 KB
/
Pen.xml
File metadata and controls
1863 lines (1692 loc) · 113 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="Pen" FullName="System.Drawing.Pen">
<TypeSignature Language="C#" Value="public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit Pen extends System.MarshalByRefObject implements class System.ICloneable, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:System.Drawing.Pen" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class Pen
Inherits MarshalByRefObject
Implements ICloneable, IDisposable" />
<TypeSignature Language="F#" Value="type Pen = class
 inherit MarshalByRefObject
 interface ICloneable
 interface IDisposable" />
<TypeSignature Language="C++ CLI" Value="public ref class Pen sealed : MarshalByRefObject, ICloneable, IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.1</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.Drawing.Common" FromVersion="11.0.0.0" To="System.Drawing" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.6.2-pp;netframework-4.7.1-pp;netframework-4.7.2-pp;netframework-4.7-pp;netframework-4.8.1-pp;netframework-4.8-pp" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.MarshalByRefObject</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.ICloneable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0-pp;net-11.0-pp;windowsdesktop-10.0;windowsdesktop-11.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Defines an object used to draw lines and curves. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><]
## Examples
The following code example demonstrates constructing a <xref:System.Drawing.Pen> with a <xref:System.Drawing.Pen.Brush*> and the effects of setting the <xref:System.Drawing.Pen.LineJoin> property on a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowLineJoin` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Pen" /> class with the specified color.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Pen (System.Drawing.Brush brush);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Drawing.Brush brush) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.#ctor(System.Drawing.Brush)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (brush As Brush)" />
<MemberSignature Language="F#" Value="new System.Drawing.Pen : System.Drawing.Brush -> System.Drawing.Pen" Usage="new System.Drawing.Pen brush" />
<MemberSignature Language="C++ CLI" Value="public:
 Pen(System::Drawing::Brush ^ brush);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="brush" Type="System.Drawing.Brush" />
</Parameters>
<Docs>
<param name="brush">A <see cref="T:System.Drawing.Brush" /> that determines the fill properties of this <see cref="T:System.Drawing.Pen" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Pen" /> class with the specified <see cref="T:System.Drawing.Brush" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Drawing.Pen.Brush> property determines how the <xref:System.Drawing.Pen> draws lines. Lines are drawn as if they are filled rectangles, with the characteristics of the specified <xref:System.Drawing.Brush>.
The <xref:System.Drawing.Pen.Width> property of the new <xref:System.Drawing.Pen> is set to 1 (the default).
## Examples
The following code example demonstrates constructing a <xref:System.Drawing.Pen> with a <xref:System.Drawing.Pen.Brush*> and the effects of setting the <xref:System.Drawing.Pen.LineJoin> property on a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowLineJoin` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="brush" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Pen (System.Drawing.Color color);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Drawing.Color color) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.#ctor(System.Drawing.Color)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (color As Color)" />
<MemberSignature Language="F#" Value="new System.Drawing.Pen : System.Drawing.Color -> System.Drawing.Pen" Usage="new System.Drawing.Pen color" />
<MemberSignature Language="C++ CLI" Value="public:
 Pen(System::Drawing::Color color);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="color" Type="System.Drawing.Color" />
</Parameters>
<Docs>
<param name="color">A <see cref="T:System.Drawing.Color" /> structure that indicates the color of this <see cref="T:System.Drawing.Pen" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Pen" /> class with the specified color.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Drawing.Color> property is set to the color specified by the `color` parameter. The <xref:System.Drawing.Pen.Width> property is set to 1 (the default).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Pen (System.Drawing.Brush brush, float width);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Drawing.Brush brush, float32 width) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.#ctor(System.Drawing.Brush,System.Single)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (brush As Brush, width As Single)" />
<MemberSignature Language="F#" Value="new System.Drawing.Pen : System.Drawing.Brush * single -> System.Drawing.Pen" Usage="new System.Drawing.Pen (brush, width)" />
<MemberSignature Language="C++ CLI" Value="public:
 Pen(System::Drawing::Brush ^ brush, float width);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="brush" Type="System.Drawing.Brush" />
<Parameter Name="width" Type="System.Single" />
</Parameters>
<Docs>
<param name="brush">A <see cref="T:System.Drawing.Brush" /> that determines the characteristics of this <see cref="T:System.Drawing.Pen" />.</param>
<param name="width">The width of the new <see cref="T:System.Drawing.Pen" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Pen" /> class with the specified <see cref="T:System.Drawing.Brush" /> and <see cref="P:System.Drawing.Pen.Width" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Drawing.Brush> is set to the color specified in the `brush` parameter, the <xref:System.Drawing.Pen.Width> property is set to the value specified in the `width` parameter, and the units are set to <xref:System.Drawing.GraphicsUnit.World>.
Note that the `brush` parameter also specifies the <xref:System.Drawing.Color> property of this <xref:System.Drawing.Pen>.
If this value is 0, the width in device units is always 1 pixel— it is not affected by scale-transform operations that are in effect for the Graphics object that the <xref:System.Drawing.Pen> is used for.
## Examples
The following code example creates a <xref:System.Drawing.Pen> and demonstrates the effects of setting the <xref:System.Drawing.Pen.StartCap*> and <xref:System.Drawing.Pen.EndCap*> properties on a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowStartAndEndCaps` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.ImageExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Bitmap/Overview/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Bitmap/Overview/form1.vb" id="Snippet3":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="brush" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public Pen (System.Drawing.Color color, float width);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Drawing.Color color, float32 width) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.#ctor(System.Drawing.Color,System.Single)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (color As Color, width As Single)" />
<MemberSignature Language="F#" Value="new System.Drawing.Pen : System.Drawing.Color * single -> System.Drawing.Pen" Usage="new System.Drawing.Pen (color, width)" />
<MemberSignature Language="C++ CLI" Value="public:
 Pen(System::Drawing::Color color, float width);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="color" Type="System.Drawing.Color" />
<Parameter Name="width" Type="System.Single" />
</Parameters>
<Docs>
<param name="color">A <see cref="T:System.Drawing.Color" /> structure that indicates the color of this <see cref="T:System.Drawing.Pen" />.</param>
<param name="width">A value indicating the width of this <see cref="T:System.Drawing.Pen" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Pen" /> class with the specified <see cref="T:System.Drawing.Color" /> and <see cref="P:System.Drawing.Pen.Width" /> properties.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Drawing.Color> property is set to the color specified by the `color` parameter. The <xref:System.Drawing.Pen.Width> property is set to the value specified in the `width` parameter. If this value is 0, the width in device units is always 1 pixel— it is not affected by scale-transform operations that are in effect for the Graphics object that the <xref:System.Drawing.Pen> is used for.
## Examples
The following code example demonstrates creating a <xref:System.Drawing.Pen> and the effects of setting the <xref:System.Drawing.Pen.DashCap*>, <xref:System.Drawing.Pen.DashPattern*>, and <xref:System.Drawing.Graphics.SmoothingMode*> properties.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowPensAndSmoothingMode` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing e as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet3":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Alignment">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.PenAlignment Alignment { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Drawing2D.PenAlignment Alignment" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.Alignment" />
<MemberSignature Language="VB.NET" Value="Public Property Alignment As PenAlignment" />
<MemberSignature Language="F#" Value="member this.Alignment : System.Drawing.Drawing2D.PenAlignment with get, set" Usage="System.Drawing.Pen.Alignment" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::PenAlignment Alignment { System::Drawing::Drawing2D::PenAlignment get(); void set(System::Drawing::Drawing2D::PenAlignment value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.PenAlignment</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the alignment for this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Drawing2D.PenAlignment" /> that represents the alignment for this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property determines how the <xref:System.Drawing.Pen> draws closed curves and polygons. The <xref:System.Drawing.Drawing2D.PenAlignment> enumeration specifies five values; however, only two values - <xref:System.Drawing.Drawing2D.PenAlignment.Center> and <xref:System.Drawing.Drawing2D.PenAlignment.Inset> - will change the appearance of a drawn line. <xref:System.Drawing.Drawing2D.PenAlignment.Center> is the default value for this property and specifies that the width of the pen is centered on the outline of the curve or polygon. A value of <xref:System.Drawing.Drawing2D.PenAlignment.Inset> for this property specifies that the width of the pen is inside the outline of the curve or polygon. The other three values, <xref:System.Drawing.Drawing2D.PenAlignment.Right>, <xref:System.Drawing.Drawing2D.PenAlignment.Left>, and <xref:System.Drawing.Drawing2D.PenAlignment.Outset>, will result in a pen that is centered.
A <xref:System.Drawing.Pen> that has its alignment set to <xref:System.Drawing.Drawing2D.PenAlignment.Inset> will yield unreliable results, sometimes drawing in the inset position and sometimes in the centered position. Also, an inset pen cannot be used to draw compound lines and cannot draw dashed lines with <xref:System.Drawing.Drawing2D.DashCap.Triangle> dash caps.
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value is not a member of <see cref="T:System.Drawing.Drawing2D.PenAlignment" />.</exception>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.Alignment" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="Brush">
<MemberSignature Language="C#" Value="public System.Drawing.Brush Brush { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Brush Brush" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.Brush" />
<MemberSignature Language="VB.NET" Value="Public Property Brush As Brush" />
<MemberSignature Language="F#" Value="member this.Brush : System.Drawing.Brush with get, set" Usage="System.Drawing.Pen.Brush" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Brush ^ Brush { System::Drawing::Brush ^ get(); void set(System::Drawing::Brush ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Brush</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see cref="T:System.Drawing.Brush" /> that determines attributes of this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Brush" /> that determines attributes of this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Assigning this property causes the pen to draw filled lines and curves. It overrides the <xref:System.Drawing.Color> property of the <xref:System.Drawing.Pen>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.Brush" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="public object Clone ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.Clone" />
<MemberSignature Language="VB.NET" Value="Public Function Clone () As Object" />
<MemberSignature Language="F#" Value="abstract member Clone : unit -> obj
override this.Clone : unit -> obj" Usage="pen.Clone " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual System::Object ^ Clone();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.ICloneable.Clone</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an exact copy of this <see cref="T:System.Drawing.Pen" />.</summary>
<returns>An <see cref="T:System.Object" /> that can be cast to a <see cref="T:System.Drawing.Pen" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example is designed for use with Windows Forms, and it requires <xref:System.Windows.Forms.PaintEventArgs> `e`, which is a parameter of the <xref:System.Windows.Forms.Control.Paint> event handler. The code performs the following actions:
- Creates a <xref:System.Drawing.Pen>.
- Creates a copy of that pen.
- Draws a line to the screen, using the copy of the pen.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.ClassicPenExamples/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Pen/Clone/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Pen/Clone/form1.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Color">
<MemberSignature Language="C#" Value="public System.Drawing.Color Color { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color Color" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.Color" />
<MemberSignature Language="VB.NET" Value="Public Property Color As Color" />
<MemberSignature Language="F#" Value="member this.Color : System.Drawing.Color with get, set" Usage="System.Drawing.Pen.Color" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Color Color { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the color of this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Color" /> structure that represents the color of this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.Color" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="CompoundArray">
<MemberSignature Language="C#" Value="public float[] CompoundArray { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float32[] CompoundArray" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.CompoundArray" />
<MemberSignature Language="VB.NET" Value="Public Property CompoundArray As Single()" />
<MemberSignature Language="F#" Value="member this.CompoundArray : single[] with get, set" Usage="System.Drawing.Pen.CompoundArray" />
<MemberSignature Language="C++ CLI" Value="public:
 property cli::array <float> ^ CompoundArray { cli::array <float> ^ get(); void set(cli::array <float> ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single[]</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an array of values that specifies a compound pen. A compound pen draws a compound line made up of parallel lines and spaces.</summary>
<value>An array of real numbers that specifies the compound array. The elements in the array must be in increasing order, not less than 0, and not greater than 1.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A compound line is made up of alternating parallel lines and spaces of varying widths. The values in the array specify the starting points of each component of the compound line relative to the pen's width. The first value in the array specifies where the first component (a line) begins as a fraction of the distance across the width of the pen. The second value in the array specifies the beginning of the next component (a space) as a fraction of the distance across the width of the pen. The final value in the array specifies where the last component ends.
Suppose you want a pen to draw two parallel lines where the width of the first line is 20 percent of the pen's width, the width of the space that separates the two lines is 50 percent of the pen' s width, and the width of the second line is 30 percent of the pen's width. Start by creating a <xref:System.Drawing.Pen> and an array of real numbers. Set the compound array by passing the array with the values 0.0, 0.2, 0.7, and 1.0 to this property.
Do not set this property if the <xref:System.Drawing.Pen> has its <xref:System.Drawing.Pen.Alignment> property set to <xref:System.Drawing.Drawing2D.PenAlignment.Inset>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.CompoundArray" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="CustomEndCap">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.CustomLineCap CustomEndCap { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Drawing2D.CustomLineCap CustomEndCap" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.CustomEndCap" />
<MemberSignature Language="VB.NET" Value="Public Property CustomEndCap As CustomLineCap" />
<MemberSignature Language="F#" Value="member this.CustomEndCap : System.Drawing.Drawing2D.CustomLineCap with get, set" Usage="System.Drawing.Pen.CustomEndCap" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::CustomLineCap ^ CustomEndCap { System::Drawing::Drawing2D::CustomLineCap ^ get(); void set(System::Drawing::Drawing2D::CustomLineCap ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.CustomLineCap</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a custom cap to use at the end of lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Drawing2D.CustomLineCap" /> that represents the cap used at the end of lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.CustomEndCap" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="CustomStartCap">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.CustomLineCap CustomStartCap { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Drawing.Drawing2D.CustomLineCap CustomStartCap" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.CustomStartCap" />
<MemberSignature Language="VB.NET" Value="Public Property CustomStartCap As CustomLineCap" />
<MemberSignature Language="F#" Value="member this.CustomStartCap : System.Drawing.Drawing2D.CustomLineCap with get, set" Usage="System.Drawing.Pen.CustomStartCap" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::CustomLineCap ^ CustomStartCap { System::Drawing::Drawing2D::CustomLineCap ^ get(); void set(System::Drawing::Drawing2D::CustomLineCap ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.CustomLineCap</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a custom cap to use at the beginning of lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Drawing2D.CustomLineCap" /> that represents the cap used at the beginning of lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.CustomStartCap" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="DashCap">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.DashCap DashCap { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Drawing2D.DashCap DashCap" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.DashCap" />
<MemberSignature Language="VB.NET" Value="Public Property DashCap As DashCap" />
<MemberSignature Language="F#" Value="member this.DashCap : System.Drawing.Drawing2D.DashCap with get, set" Usage="System.Drawing.Pen.DashCap" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::DashCap DashCap { System::Drawing::Drawing2D::DashCap get(); void set(System::Drawing::Drawing2D::DashCap value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.DashCap</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the cap style used at the end of the dashes that make up dashed lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>One of the <see cref="T:System.Drawing.Drawing2D.DashCap" /> values that represents the cap style used at the beginning and end of the dashes that make up dashed lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Do not set this property to <xref:System.Drawing.Drawing2D.DashCap.Triangle> if the <xref:System.Drawing.Pen> has its <xref:System.Drawing.Pen.Alignment> property set to <xref:System.Drawing.Drawing2D.PenAlignment.Inset>.
## Examples
The following code example demonstrates creating a <xref:System.Drawing.Pen> and the effects of setting the <xref:System.Drawing.Pen.DashCap*>, <xref:System.Drawing.Pen.DashPattern*>, and <xref:System.Drawing.Graphics.SmoothingMode*> properties.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowPensAndSmoothingMode` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet3":::
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value is not a member of <see cref="T:System.Drawing.Drawing2D.DashCap" />.</exception>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.DashCap" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="DashOffset">
<MemberSignature Language="C#" Value="public float DashOffset { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float32 DashOffset" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.DashOffset" />
<MemberSignature Language="VB.NET" Value="Public Property DashOffset As Single" />
<MemberSignature Language="F#" Value="member this.DashOffset : single with get, set" Usage="System.Drawing.Pen.DashOffset" />
<MemberSignature Language="C++ CLI" Value="public:
 property float DashOffset { float get(); void set(float value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the distance from the start of a line to the beginning of a dash pattern.</summary>
<value>The distance from the start of a line to the beginning of a dash pattern.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.DashOffset" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="DashPattern">
<MemberSignature Language="C#" Value="public float[] DashPattern { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance float32[] DashPattern" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.DashPattern" />
<MemberSignature Language="VB.NET" Value="Public Property DashPattern As Single()" />
<MemberSignature Language="F#" Value="member this.DashPattern : single[] with get, set" Usage="System.Drawing.Pen.DashPattern" />
<MemberSignature Language="C++ CLI" Value="public:
 property cli::array <float> ^ DashPattern { cli::array <float> ^ get(); void set(cli::array <float> ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single[]</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an array of custom dashes and spaces.</summary>
<value>An array of real numbers that specifies the lengths of alternating dashes and spaces in dashed lines.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Assigning a value other than `null` to this property will set the <xref:System.Drawing.Drawing2D.DashStyle> property for this <xref:System.Drawing.Pen> to <xref:System.Drawing.Drawing2D.DashStyle.Custom>.
The elements in the `dashArray` array set the length of each dash and space in the dash pattern. The first element sets the length of a dash, the second element sets the length of a space, the third element sets the length of a dash, and so on. Consequently, each element should be a non-zero positive number.
The length of each dash and space in the dash pattern is the product of the element value in the array and the width of the <xref:System.Drawing.Pen>.
## Examples
The following code example demonstrates the effects of setting the <xref:System.Drawing.Pen.DashCap*>, <xref:System.Drawing.Pen.DashPattern*>, and <xref:System.Drawing.Graphics.SmoothingMode*> properties.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowPensAndSmoothingMode` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet3":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.DashPattern" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="DashStyle">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.DashStyle DashStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Drawing2D.DashStyle DashStyle" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.DashStyle" />
<MemberSignature Language="VB.NET" Value="Public Property DashStyle As DashStyle" />
<MemberSignature Language="F#" Value="member this.DashStyle : System.Drawing.Drawing2D.DashStyle with get, set" Usage="System.Drawing.Pen.DashStyle" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::DashStyle DashStyle { System::Drawing::Drawing2D::DashStyle get(); void set(System::Drawing::Drawing2D::DashStyle value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.DashStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the style used for dashed lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Drawing2D.DashStyle" /> that represents the style used for dashed lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A value of <xref:System.Drawing.Drawing2D.DashStyle.Custom> for this property specifies that a custom pattern of dashes and spaces, defined by the <xref:System.Drawing.Pen.DashPattern> property, makes up lines drawn with this <xref:System.Drawing.Pen>. If the value of this property is <xref:System.Drawing.Drawing2D.DashStyle.Custom> and the value of the <xref:System.Drawing.Pen.DashPattern> property is `null`, the pen draws solid lines.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.DashStyle" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="pen.Dispose " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by this <see cref="T:System.Drawing.Pen" />.</summary>
<remarks>
<format type="text/markdown">< and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
> [!NOTE]
> Always call <xref:System.Drawing.Pen.Dispose*> before you release your last reference to the <xref:System.Drawing.Pen>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Drawing.Pen> object's `Finalize` method.
## Examples
The following code example demonstrates the effects of setting the <xref:System.Drawing.Pen.Width*> and <xref:System.Drawing.Pen.LineJoin*> properties, and shows how to call the <xref:System.Drawing.Pen.Dispose*> method for a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowLineJoin` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EndCap">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.LineCap EndCap { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Drawing2D.LineCap EndCap" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.EndCap" />
<MemberSignature Language="VB.NET" Value="Public Property EndCap As LineCap" />
<MemberSignature Language="F#" Value="member this.EndCap : System.Drawing.Drawing2D.LineCap with get, set" Usage="System.Drawing.Pen.EndCap" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::LineCap EndCap { System::Drawing::Drawing2D::LineCap get(); void set(System::Drawing::Drawing2D::LineCap value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.LineCap</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the cap style used at the end of lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>One of the <see cref="T:System.Drawing.Drawing2D.LineCap" /> values that represents the cap style used at the end of lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates the effects of setting the <xref:System.Drawing.Pen.StartCap*> and <xref:System.Drawing.Pen.EndCap*> properties on a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowStartAndEndCaps` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The specified value is not a member of <see cref="T:System.Drawing.Drawing2D.LineCap" />.</exception>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.EndCap" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>
<Member MemberName="Finalize">
<MemberSignature Language="C#" Value="~Pen ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Finalize() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Drawing.Pen.Finalize" />
<MemberSignature Language="VB.NET" Value="Finalize ()" />
<MemberSignature Language="F#" Value="override this.Finalize : unit -> unit" Usage="pen.Finalize " />
<MemberSignature Language="C++ CLI" Value="!Pen ()" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="LineJoin">
<MemberSignature Language="C#" Value="public System.Drawing.Drawing2D.LineJoin LineJoin { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Drawing2D.LineJoin LineJoin" />
<MemberSignature Language="DocId" Value="P:System.Drawing.Pen.LineJoin" />
<MemberSignature Language="VB.NET" Value="Public Property LineJoin As LineJoin" />
<MemberSignature Language="F#" Value="member this.LineJoin : System.Drawing.Drawing2D.LineJoin with get, set" Usage="System.Drawing.Pen.LineJoin" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Drawing::Drawing2D::LineJoin LineJoin { System::Drawing::Drawing2D::LineJoin get(); void set(System::Drawing::Drawing2D::LineJoin value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Drawing</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Drawing.Common</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Drawing2D.LineJoin</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the join style for the ends of two consecutive lines drawn with this <see cref="T:System.Drawing.Pen" />.</summary>
<value>A <see cref="T:System.Drawing.Drawing2D.LineJoin" /> that represents the join style for the ends of two consecutive lines drawn with this <see cref="T:System.Drawing.Pen" />.</value>
<remarks>
<format type="text/markdown"><
## Examples
The following code example demonstrates the effects of setting the <xref:System.Drawing.Pen.Width*> and <xref:System.Drawing.Pen.LineJoin*> properties on a <xref:System.Drawing.Pen>.
This example is designed to be used with Windows Forms. Paste the code into a form and call the `ShowLineJoin` method when handling the form's <xref:System.Windows.Forms.Control.Paint> event, passing `e` as <xref:System.Windows.Forms.PaintEventArgs> .
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PensExample/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.Drawing/Graphics/SmoothingMode/form1.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Pen.LineJoin" /> property is set on an immutable <see cref="T:System.Drawing.Pen" />, such as those returned by the <see cref="T:System.Drawing.Pens" /> class.</exception>
</Docs>
</Member>