Skip to content

Update links for System.Drawing #9788

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 1 commit into from
Apr 3, 2024
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
30 changes: 15 additions & 15 deletions xml/System.Drawing.Drawing2D/LineCap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@
<Docs>
<summary>Specifies the available cap styles with which a <see cref="T:System.Drawing.Pen" /> object can end a line.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can draw the start or end of a line in one of several shapes called line caps. GDI+ supports several line caps, such as round, square, diamond, and arrowhead. The following illustration shows a line with a round cap and an arrow cap.
![Pens](~/add/media/pens4.gif "Pens")
## Examples
The following example draws a line with an arrowhead at one end and a round cap at the other end. To run this example, Create a Windows Form and handle the form's <xref:System.Windows.Forms.Control.Paint> event. Paste the example code into the <xref:System.Windows.Forms.Control.Paint> event handler passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
<format type="text/markdown"><![CDATA[

## Remarks
You can draw the start or end of a line in one of several shapes called line caps. GDI+ supports several line caps, such as round, square, diamond, and arrowhead. The following illustration shows a line with a round cap and an arrow cap.

![Pens](~/add/media/pens4.gif "Pens")



## Examples
The following example draws a line with an arrowhead at one end and a round cap at the other end. To run this example, Create a Windows Form and handle the form's <xref:System.Windows.Forms.Control.Paint> event. Paste the example code into the <xref:System.Windows.Forms.Control.Paint> event handler passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.

:::code language="csharp" source="~/snippets/csharp/System.Drawing/Rectangle/Overview/Class1.cs" id="Snippet71":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.UsingAPen/VB/Class1.vb" id="Snippet71":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.UsingAPen/VB/Class1.vb" id="Snippet71":::

]]></format>
</remarks>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
<Members>
<Member MemberName="AnchorMask">
Expand Down
11 changes: 6 additions & 5 deletions xml/System.Drawing/Brushes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@

## Remarks

The <xref:System.Drawing.Brushes> class contains `static` read-only properties that return a <xref:System.Drawing.Brush> object of the color indicated by the property name. You typically do not have to explicitly dispose of the brush returned by a property in this class, unless it is used to construct a new brush. For more information about the colors represented by the brushes in this class, see [List of colors by name](https://www.colorhexa.com/color-names).
The <xref:System.Drawing.Brushes> class contains `static` read-only properties that return a <xref:System.Drawing.Brush> object of the color indicated by the property name. You typically do not have to explicitly dispose of the brush returned by a property in this class, unless it is used to construct a new brush. For more information about the colors represented by the brushes in this class, see [List of colors by name](/uwp/api/windows.ui.colors#remarks).

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

## Examples
The following code example demonstrates the how to use a member of the <xref:System.Drawing.Brushes> class to fill a <xref:System.Drawing.Rectangle>. This example should be used with a Windows Form. Paste this code into a form and call this 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.RectanglesAndPoints/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Brushes/Overview/form1.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.RectanglesAndPoints/VB/form1.vb" id="Snippet2":::
The following code example demonstrates the how to use a member of the <xref:System.Drawing.Brushes> class to fill a <xref:System.Drawing.Rectangle>. This example should be used with a Windows Form. Paste this code into a form and call this 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.RectanglesAndPoints/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Brushes/Overview/form1.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.RectanglesAndPoints/VB/form1.vb" id="Snippet2":::

]]></format>
</remarks>
Expand Down
13 changes: 7 additions & 6 deletions xml/System.Drawing/Color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@ Named colors are represented by using the properties of the <xref:System.Drawing

The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). Each of the four components is a number from 0 through 255, with 0 representing no intensity and 255 representing full intensity. The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. To determine the alpha, red, green, or blue component of a color, use the <xref:System.Drawing.Color.A%2A>, <xref:System.Drawing.Color.R%2A>, <xref:System.Drawing.Color.G%2A>, or <xref:System.Drawing.Color.B%2A> property, respectively. You can create a custom color by using one of the <xref:System.Drawing.Color.FromArgb%2A> methods.

For more information about these colors, see [List of colors by name](https://www.colorhexa.com/color-names).
For more information about these colors, see [List of colors by name](/uwp/api/windows.ui.colors#remarks).

## Examples
The following code example demonstrates the <xref:System.Drawing.Color.A%2A>, <xref:System.Drawing.Color.R%2A>, <xref:System.Drawing.Color.G%2A>, and <xref:System.Drawing.Color.B%2A> properties of a <xref:System.Drawing.Color>, and the <xref:System.Drawing.Size.op_Implicit%2A> member.

This example is designed to be used with a Windows Form. Paste the code into the form and call the `ShowPropertiesOfSlateBlue` method from the form's <xref:System.Windows.Forms.Control.Paint> event-handling method, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.
The following code example demonstrates the <xref:System.Drawing.Color.A%2A>, <xref:System.Drawing.Color.R%2A>, <xref:System.Drawing.Color.G%2A>, and <xref:System.Drawing.Color.B%2A> properties of a <xref:System.Drawing.Color>, and the <xref:System.Drawing.Size.op_Implicit%2A> member.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet3":::
This example is designed to be used with a Windows Form. Paste the code into the form and call the `ShowPropertiesOfSlateBlue` method from the form's <xref:System.Windows.Forms.Control.Paint> event-handling method, passing `e` as <xref:System.Windows.Forms.PaintEventArgs>.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Color/Overview/form1.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PointsAndSizes/VB/form1.vb" id="Snippet3":::

]]></format>
</remarks>
Expand Down
10 changes: 5 additions & 5 deletions xml/System.Drawing/Graphics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

You can obtain a <xref:System.Drawing.Graphics> object by calling the <xref:System.Windows.Forms.Control.CreateGraphics%2A?displayProperty=nameWithType> method on an object that inherits from <xref:System.Windows.Forms.Control?displayProperty=nameWithType>, or by handling a control's <xref:System.Windows.Forms.Control.Paint?displayProperty=nameWithType> event and accessing the <xref:System.Windows.Forms.PaintEventArgs.Graphics%2A> property of the <xref:System.Windows.Forms.PaintEventArgs?displayProperty=nameWithType> class. You can also create a <xref:System.Drawing.Graphics> object from an image by using the <xref:System.Drawing.Graphics.FromImage%2A> method. For more information about creating a <xref:System.Drawing.Graphics> object, see [How to: Create Graphics Objects for Drawing](/dotnet/framework/winforms/advanced/how-to-create-graphics-objects-for-drawing).

You can draw many different shapes and lines by using a <xref:System.Drawing.Graphics> object. For more information about how to draw lines and shapes, see the specific `Draw`*GraphicalElement* method for the line or shape you want to draw. These methods include <xref:System.Drawing.Graphics.DrawLine%2A>, <xref:System.Drawing.Graphics.DrawArc%2A>, <xref:System.Drawing.Graphics.DrawClosedCurve%2A>, <xref:System.Drawing.Graphics.DrawPolygon%2A>, and <xref:System.Drawing.Graphics.DrawRectangle%2A>. For more information about how to draw lines and shapes, see [Using a Pen to Draw Lines and Shapes](/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes) and [Using a Brush to Fill Shapes](/dotnet/framework/winforms/advanced/using-a-brush-to-fill-shapes).
You can draw many different shapes and lines by using a <xref:System.Drawing.Graphics> object. For more information about how to draw lines and shapes, see the specific `Draw`*GraphicalElement* method for the line or shape you want to draw. These methods include <xref:System.Drawing.Graphics.DrawLine%2A>, <xref:System.Drawing.Graphics.DrawArc%2A>, <xref:System.Drawing.Graphics.DrawClosedCurve%2A>, <xref:System.Drawing.Graphics.DrawPolygon%2A>, and <xref:System.Drawing.Graphics.DrawRectangle%2A>. For more information about how to draw lines and shapes, see [Using a Pen to Draw Lines and Shapes](/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes) and [Using a Brush to Fill Shapes](/dotnet/framework/winforms/advanced/using-a-brush-to-fill-shapes).

You can also draw images and icons by using the <xref:System.Drawing.Graphics.DrawImage%2A> and <xref:System.Drawing.Graphics.DrawIcon%2A> methods, respectively. To perform a bit-block transfer of color data from the screen to the drawing surface of the <xref:System.Drawing.Graphics> object, see <xref:System.Drawing.Graphics.CopyFromScreen%2A>. For more information about how to draw images with a <xref:System.Drawing.Graphics> object, see [Working with Images, Bitmaps, Icons, and Metafiles](/dotnet/desktop/winforms/advanced/images-bitmaps-and-metafiles).

Expand Down Expand Up @@ -7015,7 +7015,7 @@ The <see cref="T:System.Drawing.Graphics" /> object has a transform applied othe
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="pen" /> is <see langword="null" />.</exception>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
</Member>
<Member MemberName="DrawLine">
Expand Down Expand Up @@ -7085,7 +7085,7 @@ The <see cref="T:System.Drawing.Graphics" /> object has a transform applied othe
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="pen" /> is <see langword="null" />.</exception>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
</Member>
<Member MemberName="DrawLine">
Expand Down Expand Up @@ -7157,7 +7157,7 @@ The <see cref="T:System.Drawing.Graphics" /> object has a transform applied othe
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="pen" /> is <see langword="null" />.</exception>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
</Member>
<Member MemberName="DrawLine">
Expand Down Expand Up @@ -7229,7 +7229,7 @@ The <see cref="T:System.Drawing.Graphics" /> object has a transform applied othe
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="pen" /> is <see langword="null" />.</exception>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
</Member>
<MemberGroup MemberName="DrawLines">
Expand Down
13 changes: 7 additions & 6 deletions xml/System.Drawing/Pens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@

## Remarks

The <xref:System.Drawing.Pen> objects returned by this class are immutable, meaning their properties cannot be changed. To see the colors represented by the pens in this class, see [List of colors by name](https://www.colorhexa.com/color-names).
The <xref:System.Drawing.Pen> objects returned by this class are immutable, meaning their properties cannot be changed. For the colors represented by the pens in this class, see [List of colors by name](/uwp/api/windows.ui.colors#remarks).

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

## Examples
The following method demonstrates how to use the <xref:System.Drawing.Pens> class. This example is designed to be used with Windows Forms. Paste the code into a form and call the `UsePensClass` 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="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PensExample/VB/form1.vb" id="Snippet4":::
The following method demonstrates how to use the <xref:System.Drawing.Pens> class. This example is designed to be used with Windows Forms. Paste the code into a form and call the `UsePensClass` 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="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Drawing/Graphics/SmoothingMode/form1.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.PensExample/VB/form1.vb" id="Snippet4":::

]]></format>
</remarks>
<related type="Article" href="/dotnet/framework/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
<related type="Article" href="/dotnet/desktop/winforms/advanced/using-a-pen-to-draw-lines-and-shapes">Using a Pen to Draw Lines and Shapes</related>
</Docs>
<Members>
<Member MemberName="AliceBlue">
Expand Down
Loading