Skip to content

Add note about Drawing on non-Windows OS #7023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions includes/system-drawing-common.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> [!NOTE]
> In .NET 6 and later versions, the [System.Drawing.Common package](https://www.nuget.org/packages/System.Drawing.Common/), which includes this type, is only supported on Windows operating systems. Use of this type in cross-platform apps causes compile-time warnings and run-time exceptions. For more information, see [System.Drawing.Common only supported on Windows](/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only).
82 changes: 45 additions & 37 deletions xml/System.Drawing.Drawing2D/AdjustableArrowCap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
<Interfaces />
<Docs>
<summary>Represents an adjustable arrow-shaped line cap. This class cannot be inherited.</summary>
<remarks>To be added.</remarks>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

[!INCLUDE[System.Drawing.Common note](~/includes/system-drawing-common.md)]

]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
Expand Down Expand Up @@ -76,21 +84,21 @@
<param name="height">The height of the arrow.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Drawing2D.AdjustableArrowCap" /> class with the specified width and height. The arrow end caps created with this constructor are always filled.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example is designed for use with Windows Forms, and it requires <xref:System.Windows.Forms.PaintEventArgs>`e`, an <xref:System.Windows.Forms.Control.OnPaint%2A> event object. The code performs the following actions:
- Creates an <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object named `myArrow`.
- Creates a <xref:System.Drawing.Pen> object named `capPen`, and sets its <xref:System.Drawing.Pen.CustomStartCap%2A> and <xref:System.Drawing.Pen.CustomEndCap%2A> properties equal to `myArrow`.
- Uses the <xref:System.Drawing.Graphics.DrawLine%2A> method to draw to screen a line capped by two arrows.
<format type="text/markdown"><![CDATA[

## Examples
The following example is designed for use with Windows Forms, and it requires <xref:System.Windows.Forms.PaintEventArgs>`e`, an <xref:System.Windows.Forms.Control.OnPaint%2A> event object. The code performs the following actions:

- Creates an <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object named `myArrow`.

- Creates a <xref:System.Drawing.Pen> object named `capPen`, and sets its <xref:System.Drawing.Pen.CustomStartCap%2A> and <xref:System.Drawing.Pen.CustomEndCap%2A> properties equal to `myArrow`.

- Uses the <xref:System.Drawing.Graphics.DrawLine%2A> method to draw to screen a line capped by two arrows.

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/CS/form1.cs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/VB/form1.vb" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/VB/form1.vb" id="Snippet1":::

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -130,21 +138,21 @@
<see langword="true" /> to fill the arrow cap; otherwise, <see langword="false" />.</param>
<summary>Initializes a new instance of the <see cref="T:System.Drawing.Drawing2D.AdjustableArrowCap" /> class with the specified width, height, and fill property. Whether an arrow end cap is filled depends on the argument passed to the <paramref name="isFilled" /> parameter.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example is designed for use with Windows Forms, and it requires <xref:System.Windows.Forms.PaintEventArgs>`e`, an <xref:System.Windows.Forms.Control.OnPaint%2A> event object. The code performs the following actions:
- Creates an <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object named `myArrow`.
- Creates a <xref:System.Drawing.Pen> object named `capPen`, and sets its <xref:System.Drawing.Pen.CustomStartCap%2A> and <xref:System.Drawing.Pen.CustomEndCap%2A> properties equal to `myArrow`.
- Uses the <xref:System.Drawing.Graphics.DrawLine%2A> method to draw to screen a line capped by two arrows.
<format type="text/markdown"><![CDATA[

## Examples
The following example is designed for use with Windows Forms, and it requires <xref:System.Windows.Forms.PaintEventArgs>`e`, an <xref:System.Windows.Forms.Control.OnPaint%2A> event object. The code performs the following actions:

- Creates an <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object named `myArrow`.

- Creates a <xref:System.Drawing.Pen> object named `capPen`, and sets its <xref:System.Drawing.Pen.CustomStartCap%2A> and <xref:System.Drawing.Pen.CustomEndCap%2A> properties equal to `myArrow`.

- Uses the <xref:System.Drawing.Graphics.DrawLine%2A> method to draw to screen a line capped by two arrows.

:::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/CS/form1.cs" id="Snippet2":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/VB/form1.vb" id="Snippet2":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.Drawing2D.ClassicMisc/VB/form1.vb" id="Snippet2":::

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -231,11 +239,11 @@
<summary>Gets or sets the height of the arrow cap.</summary>
<value>The height of the arrow cap.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The height of the arrow cap is scaled by the width of the <xref:System.Drawing.Pen> object used to draw the line being capped. For example, if you are drawing a capped line with a pen that has a width of 5 pixels, and the <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object has a height of 3, then the actual arrow cap is drawn 15 pixels high.
<format type="text/markdown"><![CDATA[

## Remarks
The height of the arrow cap is scaled by the width of the <xref:System.Drawing.Pen> object used to draw the line being capped. For example, if you are drawing a capped line with a pen that has a width of 5 pixels, and the <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object has a height of 3, then the actual arrow cap is drawn 15 pixels high.

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -322,11 +330,11 @@
<summary>Gets or sets the width of the arrow cap.</summary>
<value>The width, in units, of the arrow cap.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The width of the arrow cap is scaled by the width of the <xref:System.Drawing.Pen> object used to draw the line being capped. For example, if you are drawing a capped line with a pen that has a width of 5 pixels, and the <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object has a width of 3, then the actual arrow cap is drawn 15 pixels wide.
<format type="text/markdown"><![CDATA[

## Remarks
The width of the arrow cap is scaled by the width of the <xref:System.Drawing.Pen> object used to draw the line being capped. For example, if you are drawing a capped line with a pen that has a width of 5 pixels, and the <xref:System.Drawing.Drawing2D.AdjustableArrowCap> object has a width of 3, then the actual arrow cap is drawn 15 pixels wide.

]]></format>
</remarks>
</Docs>
Expand Down
Loading