> For the complete documentation index, see [llms.txt](https://docs.wisej.com/system.drawing.managed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

# Graphics

Namespace: **System.Drawing**

Assembly: **System.Drawing.Managed** (4.0.0.0)

Encapsulates a GDI+ drawing surface.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Graphics : MarshalByRefObject, IDisposable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Graphics
    Inherits MarshalByRefObject
    Implements IDisposable
```

{% endtab %}
{% endtabs %}

## Properties

### ![](/files/gN3G3VR5GgQngV3jdnfJ) Clip

[Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md): Gets or sets a [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md) that limits the drawing region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) ClipBounds

[RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef): Gets a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that bounds the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) CompositingMode

[CompositingMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.compositingmode.md): Gets or sets a value that specifies how composited images are drawn to this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) CompositingQuality

[CompositingQuality](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.compositingquality.md): Gets or sets the rendering quality of composited images drawn to this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DpiX

[Single](https://docs.microsoft.com/dotnet/api/system.single): Gets the horizontal resolution of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DpiY

[Single](https://docs.microsoft.com/dotnet/api/system.single): Gets the vertical resolution of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) InterpolationMode

[InterpolationMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.interpolationmode.md): Gets or sets the interpolation mode associated with this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) IsClipEmpty

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Gets a value indicating whether the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) is empty.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) PageScale

[Single](https://docs.microsoft.com/dotnet/api/system.single): Gets or sets the scaling between world units and page units for this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) PageUnit

[GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md): Gets or sets the unit of measure used for page coordinates in this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) PixelOffsetMode

[PixelOffsetMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.pixeloffsetmode.md): Gets or sets a value specifying how pixels are offset during rendering of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) RenderingOrigin

[Point](https://docs.microsoft.com/dotnet/api/system.drawing.point): Gets or sets the rendering origin of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) for dithering and for hatch brushes.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SmoothingMode

[SmoothingMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.smoothingmode.md): Gets or sets the rendering quality for this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) TextContrast

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Gets or sets the gamma correction value for rendering text.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) TextRenderingHint

[TextRenderingHint](/system.drawing.managed/api/system.drawing.text/system.drawing.text.textrenderinghint.md): Gets or sets the rendering mode for text associated with this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) Transform

[Matrix](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrix.md): Gets or sets a copy of the geometric world transformation for this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

GDI+ uses three coordinate spaces: world, page, and device. World coordinates are the coordinates used to model a particular graphic world and are the coordinates you pass to methods in the .NET Framework. Page coordinates refer to the coordinate system used by a drawing surface, such as a form or a control. Device coordinates are the coordinates used by the physical device being drawn on, such as a screen or a printer. The [Transform](#transform) property represents the world transformation, which maps world coordinates to page coordinates. Because the matrix returned and by the [Transform](#transform) property is a copy of the geometric transform, you should dispose of the matrix when you no longer need it.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) VisibleClipBounds

[RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef): Gets the bounding rectangle of the visible clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

## Methods

### ![](/files/gN3G3VR5GgQngV3jdnfJ) BeginContainer()

Saves a graphics container with the current state of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) and opens and uses a new graphics container.

**Returns:** [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md). The [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) BeginContainer(dstRect, srcRect, unit)

Saves a graphics container with the current state of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) and opens and uses a new graphics container with the specified scale transformation.

| Parameter   | Type                                                                                      | Description                                                                                                                                                                            |
| ----------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **dstRect** | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that, together with the *srcRect* parameter, specifies a scale transformation for the container. |
| **srcRect** | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that, together with the *dstRect* parameter, specifies a scale transformation for the container. |
| **unit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure for the *dstRect*              |

**Returns:** [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md). The [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) BeginContainer(dstRect, srcRect, unit)

Saves a graphics container with the current state of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) and opens and uses a new graphics container with the specified scale transformation.

| Parameter   | Type                                                                                      | Description                                                                                                                                                                              |
| ----------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **dstRect** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that, together with the *srcRect* parameter, specifies a scale transformation for the container. |
| **srcRect** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that, together with the *dstRect* parameter, specifies a scale transformation for the container. |
| **unit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure for the *dstRect*                |

**Returns:** [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md). The [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) Clear(color)

Clears the entire drawing surface and fills it with the specified background color.

| Parameter | Type                                                                | Description                                                                                                                                |
| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **color** | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) structure that represents the background color of the drawing surface. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) Dispose()

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawArc(pen, x, y, width, height, startAngle, sweepAngle)

Draws an arc from the specified ellipse.

| Parameter      | Type                                                                    | Description                                                                                                                     |
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the arc. |
| **x**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the upper-left corner of the rectangle that defines the ellipse.                                            |
| **y**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the upper-left corner of the rectangle that defines the ellipse.                                            |
| **width**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Width of the rectangle that defines the ellipse.                                                                                |
| **height**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Height of the rectangle that defines the ellipse.                                                                               |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Angle in degrees measured clockwise from the x-axis to the starting point of the arc.                                           |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Angle in degrees measured clockwise from the *startAngle* parameter to ending point of the arc.                                 |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawArc(pen, rect, startAngle, sweepAngle)

Draws an arc from the specified ellipse.

| Parameter      | Type                                                                          | Description                                                                                                                         |
| -------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)       | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the arc.     |
| **rect**       | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that defines the boundaries of the ellipse. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle in degrees measured clockwise from the x-axis to the starting point of the arc.                                               |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle in degrees measured clockwise from the *startAngle* parameter to ending point of the arc.                                     |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawArc(pen, x, y, width, height, startAngle, sweepAngle)

Draws an arc from the specified ellipse.

| Parameter      | Type                                                                    | Description                                                                                                                     |
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the arc. |
| **x**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the upper-left corner of the rectangle that defines the ellipse.                                            |
| **y**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the upper-left corner of the rectangle that defines the ellipse.                                            |
| **width**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Width of the rectangle that defines the ellipse.                                                                                |
| **height**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Height of the rectangle that defines the ellipse.                                                                               |
| **startAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Angle in degrees measured clockwise from the x-axis to the starting point of the arc.                                           |
| **sweepAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Angle in degrees measured clockwise from the *startAngle* parameter to ending point of the arc.                                 |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawArc(pen, rect, startAngle, sweepAngle)

Draws an arc from the specified ellipse.

| Parameter      | Type                                                                        | Description                                                                                                                         |
| -------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the arc.     |
| **rect**       | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that defines the boundaries of the ellipse. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the x-axis to the starting point of the arc.                                               |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the *startAngle* parameter to ending point of the arc.                                     |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawBezier(pen, x1, y1, x2, y2, x3, y3, x4, y4)

Draws a Bezier spline defined by four ordered pairs of coordinates that represent points.

| Parameter | Type                                                                    | Description                                                                                                                       |
| --------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve. |
| **x1**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the starting point of the curve.                                                                              |
| **y1**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the starting point of the curve.                                                                              |
| **x2**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the first control point of the curve.                                                                         |
| **y2**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the first control point of the curve.                                                                         |
| **x3**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the second control point of the curve.                                                                        |
| **y3**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the second control point of the curve.                                                                        |
| **x4**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the ending point of the curve.                                                                                |
| **y4**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the ending point of the curve.                                                                                |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawBezier(pen, pt1, pt2, pt3, pt4)

Draws a Bezier spline defined by four [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures.

| Parameter | Type                                                                    | Description                                                                                                                             |
| --------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.       |
| **pt1**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the starting point of the curve.        |
| **pt2**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the first control point for the curve.  |
| **pt3**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the second control point for the curve. |
| **pt4**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the ending point of the curve.          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawBezier(pen, pt1, pt2, pt3, pt4)

Draws a Bezier spline defined by four [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures.

| Parameter | Type                                                                    | Description                                                                                                                                 |
| --------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) structure that determines the color, width, and style of the curve. |
| **pt1**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the starting point of the curve.              |
| **pt2**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the first control point for the curve.        |
| **pt3**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the second control point for the curve.       |
| **pt4**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the ending point of the curve.                |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawBeziers(pen, points)

Draws a series of cubic Bezier curves from an array of points.

| Parameter  | Type                                                                      | Description                                                                                                                                                                                                                            |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.                                                                                                      |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represent the points that determine the curve. The number of points in the array should be a multiple of 3 plus 1, such as 4, 7, or 10. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawBeziers(pen, points)

Draws a series of cubic Bezier curves from an array of points.

| Parameter  | Type                                                                    | Description                                                                                                                                                                                                                            |
| ---------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.                                                                                                      |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represent the points that determine the curve. The number of points in the array should be a multiple of 3 plus 1, such as 4, 7, or 10. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawClosedCurve(pen, points)

Draws a closed curve defined by an array of points.

| Parameter  | Type                                                                      | Description                                                                                                                       |
| ---------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve. |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.                 |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawClosedCurve(pen, points, tension)

Draws a closed curve defined by an array of points.

| Parameter   | Type                                                                      | Description                                                                                                                       |
| ----------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **pen**     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve. |
| **points**  | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.                 |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)             | Value greater than or equal to `0.0F` that specifies the tension of the curve.                                                    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawClosedCurve(pen, points)

Draws a closed curve defined by an array of points.

| Parameter  | Type                                                                    | Description                                                                                                                       |
| ---------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve. |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.                   |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawClosedCurve(pen, points, tension)

Draws a closed curve defined by an array of points.

| Parameter   | Type                                                                    | Description                                                                                                                       |
| ----------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **pen**     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve. |
| **points**  | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.                   |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Value greater than or equal to `0.0F` that specifies the tension of the curve.                                                    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points)

Draws a curve defined by an array of points.

| Parameter  | Type                                                                      | Description                                                                                                                                    |
| ---------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.              |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | An array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represents the points that define the curve. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, tension)

Draws a curve defined by an array of points.

| Parameter   | Type                                                                      | Description                                                                                                                                    |
| ----------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.              |
| **points**  | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | An array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represents the points that define the curve. |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)             | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.            |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, offset, numberOfSegments)

Draws a curve defined by an array of points.

| Parameter            | Type                                                                      | Description                                                                                                                                    |
| -------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**              | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.              |
| **points**           | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | An array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represents the points that define the curve. |
| **offset**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)               | The index of the element in the *points* array that is used as the first point in the curve.                                                   |
| **numberOfSegments** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)               | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.                                    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, offset, numberOfSegments, tension)

Draws a curve defined by an array of points.

| Parameter            | Type                                                                      | Description                                                                                                                                    |
| -------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**              | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.              |
| **points**           | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | An array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represents the points that define the curve. |
| **offset**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)               | The index of the element in the *points* array that is used as the first point in the curve.                                                   |
| **numberOfSegments** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)               | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.                                    |
| **tension**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)             | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.            |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points)

Draws a curve defined by an array of points.

| Parameter  | Type                                                                    | Description                                                                                                                                  |
| ---------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.            |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | An array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that represents the points that define the curve. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, tension)

Draws a curve defined by an array of points.

| Parameter   | Type                                                                    | Description                                                                                                                                  |
| ----------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.            |
| **points**  | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | An array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that represents the points that define the curve. |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, offset, numberOfSegments)

Draws a curve defined by an array of points.

| Parameter            | Type                                                                    | Description                                                                                                                                    |
| -------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**              | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.              |
| **points**           | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | An array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represents the points that define the curve. |
| **offset**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The index of the element in the *points* array that is used as the first point in the curve.                                                   |
| **numberOfSegments** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.                                    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawCurve(pen, points, offset, numberOfSegments, tension)

Draws a curve defined by an array of points.

| Parameter            | Type                                                                    | Description                                                                                                                                  |
| -------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**              | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the curve.            |
| **points**           | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | An array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that represents the points that define the curve. |
| **offset**           | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The index of the element in the *points* array that is used as the first point in the curve.                                                 |
| **numberOfSegments** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The number of segments used to draw the curve. A segment can be thought of as a line connecting two points.                                  |
| **tension**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | A value that specifies the amount that the curve bends between control points. Values greater than 1 produce unpredictable results.          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawEllipse(pen, rect)

Draws the outline of an ellipse defined by a bounding rectangle.

| Parameter | Type                                                                          | Description                                                                                                                         |
| --------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)       | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the ellipse. |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that defines the boundaries of the ellipse. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawEllipse(pen, x, y, width, height)

Draws the outline of an ellipse defined by a bounding rectangle.

| Parameter  | Type                                                                    | Description                                                                                                                         |
| ---------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the ellipse. |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                       |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                       |
| **width**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Width of the bounding rectangle that defines the ellipse.                                                                           |
| **height** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Height of the bounding rectangle that defines the ellipse.                                                                          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawEllipse(pen, rect)

Draws the outline of an ellipse specified by a bounding [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure.

| Parameter | Type                                                                        | Description                                                                                                                         |
| --------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the ellipse. |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that defines the boundaries of the ellipse.   |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawEllipse(pen, x, y, width, height)

Draws the outline of an ellipse defined by a bounding rectangle specified by coordinates for the upper-left corner of the rectangle, a height, and a width.

| Parameter  | Type                                                                    | Description                                                                                                                         |
| ---------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the ellipse. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                       |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                       |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Width of the bounding rectangle that defines the ellipse.                                                                           |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Height of the bounding rectangle that defines the ellipse.                                                                          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, point)

Draws the specified image at the specified location.

| Parameter | Type                                                                        | Description                                                                                                                                             |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                    |
| **point** | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)       | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the location of the upper-left corner of the drawn image. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y)

Draws the specified image, using its original physical size, at the location specified by a coordinate pair.

| Parameter | Type                                                                        | Description                                                                          |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the drawn image.                        |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, rect)

Draws the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter | Type                                                                          | Description                                                                                                                                    |
| --------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)   | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                           |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y, width, height)

Draws the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter  | Type                                                                        | Description                                                                          |
| ---------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image**  | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the drawn image.                        |
| **width**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Width of the drawn image.                                                            |
| **height** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Height of the drawn image.                                                           |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, point)

Draws the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md), using its original physical size, at the specified location.

| Parameter | Type                                                                        | Description                                                                                                                                             |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                    |
| **point** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)         | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the location of the upper-left corner of the drawn image. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y)

Draws the specified image, using its original physical size, at the location specified by a coordinate pair.

| Parameter | Type                                                                        | Description                                                                          |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the drawn image.                        |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, rect)

Draws the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter | Type                                                                        | Description                                                                                                                                    |
| --------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                           |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y, width, height)

Draws the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter  | Type                                                                        | Description                                                                          |
| ---------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image**  | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the drawn image.                        |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Width of the drawn image.                                                            |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Height of the drawn image.                                                           |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                        | Description                                                                                                                  |
| -------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                         |
| **destPoints** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | Array of three [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define a parallelogram. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .
* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *destPoints* is .
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The number of points is not 3 or 4.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                        | Description                                                                                                                  |
| -------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                         |
| **destPoints** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | Array of three [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define a parallelogram. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .
* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *destPoints* is .
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The number of points is not 3 or 4.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y, srcRect, srcUnit)

Draws a portion of an image at a specified location.

| Parameter   | Type                                                                                      | Description                                                                                                                                                                              |
| ----------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**   | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                     |
| **x**       | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The x-coordinate of the upper-left corner of the drawn image.                                                                                                                            |
| **y**       | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The y-coordinate of the upper-left corner of the drawn image.                                                                                                                            |
| **srcRect** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the portion of the *image* object to draw.                                        |
| **srcUnit** | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used by the *srcRect* parameter. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, x, y, srcRect, srcUnit)

Draws a portion of an image at a specified location.

| Parameter   | Type                                                                                      | Description                                                                                                                                                                              |
| ----------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**   | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                     |
| **x**       | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The x-coordinate of the upper-left corner of the drawn image.                                                                                                                            |
| **y**       | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The y-coordinate of the upper-left corner of the drawn image.                                                                                                                            |
| **srcRect** | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the portion of the *image* object to draw.                                        |
| **srcUnit** | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used by the *srcRect* parameter. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcRect, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter    | Type                                                                                      | Description                                                                                                                                                                                |
| ------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **image**    | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                       |
| **destRect** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| **srcRect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the portion of the *image* object to draw.                                          |
| **srcUnit**  | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used by the *srcRect* parameter.   |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcRect, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter    | Type                                                                                      | Description                                                                                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**    | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                     |
| **destRect** | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. |
| **srcRect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the portion of the *image* object to draw.                                          |
| **srcUnit**  | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used by the *srcRect* parameter. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints, srcRect, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                                      | Description                                                                                                                                                                                     |
| -------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destPoints** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                 | Array of three [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define a parallelogram.                                                                    |
| **srcRect**    | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the portion of the *image* object to draw.                                                 |
| **srcUnit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints, srcRect, srcUnit, imageAttr)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                                                            | Description                                                                                                                                                                                     |
| -------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)                                     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destPoints** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                                       | Array of three [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define a parallelogram.                                                                    |
| **srcRect**    | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)                                   | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the portion of the *image* object to draw.                                                 |
| **srcUnit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md)                       | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |
| **imageAttr**  | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) that specifies recoloring and gamma information for the *image* object.         |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints, srcRect, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                                      | Description                                                                                                                                                                                     |
| -------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destPoints** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)                   | Array of three [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define a parallelogram.                                                                      |
| **srcRect**    | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the portion of the *image* object to draw.                                                 |
| **srcUnit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .
* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *destPoints* is .
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The number of points is not 3 or 4.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destPoints, srcRect, srcUnit, imageAttr)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter      | Type                                                                                                            | Description                                                                                                                                                                                     |
| -------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**      | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)                                     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destPoints** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)                                         | Array of three [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define a parallelogram.                                                                      |
| **srcRect**    | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)                                     | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the portion of the *image* object to draw.                                                 |
| **srcUnit**    | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md)                       | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |
| **imageAttr**  | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) that specifies recoloring and gamma information for the *image* object.         |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .
* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *destPoints* is .
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The number of points is not 3 or 4.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter     | Type                                                                                      | Description                                                                                                                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destRect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.        |
| **srcX**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The x-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcY**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The y-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcWidth**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | Width of the portion of the source image to draw.                                                                                                                                               |
| **srcHeight** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | Height of the portion of the source image to draw.                                                                                                                                              |
| **srcUnit**   | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter     | Type                                                                                                            | Description                                                                                                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)                                     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destRect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)                                     | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.        |
| **srcX**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                                   | The x-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcY**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                                   | The y-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcWidth**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                                   | Width of the portion of the source image to draw.                                                                                                                                               |
| **srcHeight** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                                   | Height of the portion of the source image to draw.                                                                                                                                              |
| **srcUnit**   | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md)                       | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |
| **imageAttr** | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) that specifies recoloring and gamma information for the *image* object.         |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter     | Type                                                                                      | Description                                                                                                                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)               | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destRect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)               | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.        |
| **srcX**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The x-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcY**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The y-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcWidth**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | Width of the portion of the source image to draw.                                                                                                                                               |
| **srcHeight** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | Height of the portion of the source image to draw.                                                                                                                                              |
| **srcUnit**   | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr)

Draws the specified portion of the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) at the specified location and with the specified size.

| Parameter     | Type                                                                                                            | Description                                                                                                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md)                                     | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                            |
| **destRect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)                                     | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle.        |
| **srcX**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                     | The x-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcY**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                     | The y-coordinate of the upper-left corner of the portion of the source image to draw.                                                                                                           |
| **srcWidth**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                     | Width of the portion of the source image to draw.                                                                                                                                               |
| **srcHeight** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                     | Height of the portion of the source image to draw.                                                                                                                                              |
| **srcUnit**   | [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md)                       | Member of the [GraphicsUnit](/system.drawing.managed/api/system.drawing/system.drawing.graphicsunit.md) enumeration that specifies the units of measure used to determine the source rectangle. |
| **imageAttr** | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) | [ImageAttributes](/system.drawing.managed/api/system.drawing.imaging/system.drawing.imaging.imageattributes.md) that specifies recoloring and gamma information for the *image* object.         |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImageUnscaled(image, x, y)

Draws the specified image using its original physical size at the location specified by a coordinate pair.

| Parameter | Type                                                                        | Description                                                                          |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the drawn image.                        |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImageUnscaled(image, x, y, width, height)

Draws a specified image using its original physical size at a specified location.

| Parameter  | Type                                                                        | Description                                                                          |
| ---------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **image**  | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the drawn image.                        |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the drawn image.                        |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Not used.                                                                            |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Not used                                                                             |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImageUnscaled(image, point)

Draws a specified image using its original physical size at a specified location.

| Parameter | Type                                                                        | Description                                                                                                                            |
| --------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                   |
| **point** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)         | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that specifies the upper-left corner of the drawn image. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImageUnscaled(image, rect)

Draws a specified image using its original physical size at a specified location.

| Parameter | Type                                                                        | Description                                                                                                                                                                                                                                              |
| --------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw.                                                                                                                                                                     |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) that specifies the upper-left corner of the drawn image. The X and Y properties of the rectangle specify the upper-left corner. The Width and Height properties are ignored. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawImageUnscaledAndClipped(image, rect)

Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.

| Parameter | Type                                                                        | Description                                                                                                 |
| --------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | The [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) to draw                     |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | The [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) in which to draw the image. |

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) *image* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLine(pen, x1, y1, x2, y2)

Draws a line connecting the two points specified by the coordinate pairs.

| Parameter | Type                                                                    | Description                                                                                                                      |
| --------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **x1**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the first point.                                                                                             |
| **y1**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the first point.                                                                                             |
| **x2**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the second point.                                                                                            |
| **y2**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the second point.                                                                                            |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLine(pen, x1, y1, x2, y2)

Draws a line connecting the two points specified by the coordinate pairs.

| Parameter | Type                                                                    | Description                                                                                                                      |
| --------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **x1**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the first point.                                                                                             |
| **y1**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the first point.                                                                                             |
| **x2**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the second point.                                                                                            |
| **y2**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the second point.                                                                                            |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLine(pen, pt1, pt2)

Draws a line connecting two [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures.

| Parameter | Type                                                                    | Description                                                                                                                      |
| --------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **pt1**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the first point to connect.        |
| **pt2**   | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structure that represents the second point to connect.       |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLine(pen, pt1, pt2)

Draws a line connecting two [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures.

| Parameter | Type                                                                    | Description                                                                                                                      |
| --------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **pt1**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the first point to connect.      |
| **pt2**   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the second point to connect.     |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLines(pen, points)

Draws a series of line segments that connect an array of points.

| Parameter  | Type                                                                    | Description                                                                                                                      |
| ---------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that represent the points to connect.    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawLines(pen, points)

Draws a series of line segments that connect an array of points.

| Parameter  | Type                                                                      | Description                                                                                                                      |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the line. |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that represent the points to connect.  |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPath(pen, path)

Draws a [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md).

| Parameter | Type                                                                                                          | Description                                                                                                                      |
| --------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)                                       | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the path. |
| **path**  | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) to draw.           |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is . -or- *path* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPie(pen, rect, startAngle, sweepAngle)

Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure. Two radial lines indicate the start and end of the pie slice.

| Parameter      | Type                                                                          | Description                                                                                                                                                                             |
| -------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)       | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the pie shape.                                                   |
| **rect**       | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.                                                                                                 |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle measured in degrees clockwise from the *startAngle* parameter to the second side of the pie shape.                                                                                |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPie(pen, x, y, width, height, startAngle, sweepAngle)

Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a coordinate pair, a width, and a height. Two radial lines indicate the start and end of the pie slice.

| Parameter      | Type                                                                    | Description                                                                                                                           |
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the pie shape. |
| **x**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.          |
| **y**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.          |
| **width**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Width of the bounding rectangle that defines the ellipse from which the pie shape comes.                                              |
| **height**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Height of the bounding rectangle that defines the ellipse from which the pie shape comes.                                             |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.                                               |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | Angle measured in degrees clockwise from the *startAngle* parameter to the second side of the pie shape.                              |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *pen* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPie(pen, rect, startAngle, sweepAngle)

Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure. Two radial lines indicate the start and end of the pie slice.

| Parameter      | Type                                                                        | Description                                                                                                                                                                           |
| -------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)     | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the pie shape.                                                 |
| **rect**       | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the bounding rectangle that defines the ellipse from which the pie shape comes. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.                                                                                               |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle measured in degrees clockwise from the *startAngle* parameter to the second side of the pie shape.                                                                              |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPie(pen, x, y, width, height, startAngle, sweepAngle)

Draws the outline of a pie shape. The pie shape is a section of an ellipse. The ellipse is specified by a coordinate pair, a width, and a height. Two radial lines indicate the start and end of the pie slice.

| Parameter      | Type                                                                    | Description                                                                                                                           |
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**        | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the pie shape. |
| **x**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.          |
| **y**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie shape comes.          |
| **width**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Width of the bounding rectangle that defines the ellipse from which the pie shape comes.                                              |
| **height**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Height of the bounding rectangle that defines the ellipse from which the pie shape comes.                                             |
| **startAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Angle measured in degrees clockwise from the x-axis to the first side of the pie shape.                                               |
| **sweepAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Angle measured in degrees clockwise from the *startAngle* parameter to the second side of the pie shape.                              |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPolygon(pen, points)

Draws the outline of a polygon defined by an array of points.

| Parameter  | Type                                                                      | Description                                                                                                                                        |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the polygon.                |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) points that represent the coordinates of the corners of the polygon |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawPolygon(pen, points)

Draws the outline of a polygon defined by an array of points.

| Parameter  | Type                                                                    | Description                                                                                                                                      |
| ---------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the polygon.              |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point) | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) points that represent the coordinates of the corners of the polygon |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangle(pen, rect)

Draws the outline of a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) rectangle specified by *rect* .

| Parameter | Type                                                                          | Description                                                                                                                             |
| --------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)       | A [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangle. |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | A [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that represents the rectangle to draw.        |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangle(pen, rect)

Draws the outline of a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) rectangle specified by *rect* .

| Parameter | Type                                                                        | Description                                                                                                                             |
| --------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)     | A [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangle. |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | A [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the rectangle to draw.          |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangle(pen, x, y, width, height)

Draws a rectangle specified by a coordinate pair, a width, and a height.

| Parameter  | Type                                                                    | Description                                                                                                                             |
| ---------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | A [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangle. |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The x-coordinate of the upper-left corner of the rectangle to draw.                                                                     |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The y-coordinate of the upper-left corner of the rectangle to draw.                                                                     |
| **width**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The width of the rectangle to draw.                                                                                                     |
| **height** | [Single](https://docs.microsoft.com/dotnet/api/system.single)           | The height of the rectangle to draw.                                                                                                    |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangle(pen, x, y, width, height)

Draws a rectangle specified by a coordinate pair, a width, and a height.

| Parameter  | Type                                                                    | Description                                                                                                                           |
| ---------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**    | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangle. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The x-coordinate of the upper-left corner of the rectangle to draw.                                                                   |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | The y-coordinate of the upper-left corner of the rectangle to draw.                                                                   |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Width of the rectangle to draw.                                                                                                       |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)             | Height of the rectangle to draw.                                                                                                      |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangles(pen, rects)

Draws a series of rectangles specified by [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structures.

| Parameter | Type                                                                              | Description                                                                                                                              |
| --------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)           | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangles.   |
| **rects** | [RectangleF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | Array of [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structures that represent the rectangles to draw. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawRectangles(pen, rects)

Draws a series of rectangles specified by [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structures.

| Parameter | Type                                                                            | Description                                                                                                                            |
| --------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **pen**   | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md)         | [Pen](/system.drawing.managed/api/system.drawing/system.drawing.pen.md) that determines the color, width, and style of the rectangles. |
| **rects** | [Rectangle\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | Array of [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structures that represent the rectangles to draw. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, x, y)

Draws the specified text string at the specified x and y coordinates with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects.

| Parameter | Type                                                                        | Description                                                                                                                          |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **s**     | [String](https://docs.microsoft.com/dotnet/api/system.string)               | String to draw.                                                                                                                      |
| **font**  | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)   | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text. |
| **x**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the drawn text.                                                                         |
| **y**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the drawn text.                                                                         |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, point)

Draws the specified text string at the specified location with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects.

| Parameter | Type                                                                        | Description                                                                                                                             |
| --------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **s**     | [String](https://docs.microsoft.com/dotnet/api/system.string)               | String to draw.                                                                                                                         |
| **font**  | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)   | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                   |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text.    |
| **point** | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)       | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that specifies the upper-left corner of the drawn text. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, x, y, format)

Draws the specified text string at the specified location with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects using the formatting attributes of the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter  | Type                                                                                      | Description                                                                                                                                                                                             |
| ---------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **s**      | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to draw.                                                                                                                                                                                         |
| **font**   | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                                                                                   |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)               | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text.                                                                    |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The x-coordinate of the upper-left corner of the drawn text.                                                                                                                                            |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)                             | The y-coordinate of the upper-left corner of the drawn text.                                                                                                                                            |
| **format** | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, point, format)

Draws the specified text string at the specified location with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects using the formatting attributes of the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter  | Type                                                                                      | Description                                                                                                                                                                                             |
| ---------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **s**      | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to draw.                                                                                                                                                                                         |
| **font**   | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                                                                                   |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)               | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text.                                                                    |
| **point**  | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                     | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that specifies the upper-left corner of the drawn text.                                                                 |
| **format** | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, layoutRectangle)

Draws the specified text string in the specified rectangle with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects.

| Parameter           | Type                                                                          | Description                                                                                                                            |
| ------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **s**               | [String](https://docs.microsoft.com/dotnet/api/system.string)                 | String to draw.                                                                                                                        |
| **font**            | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)     | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                  |
| **brush**           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text.   |
| **layoutRectangle** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the location of the drawn text. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) DrawString(s, font, brush, layoutRectangle, format)

Draws the specified text string in the specified rectangle with the specified [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) and [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) objects using the formatting attributes of the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter           | Type                                                                                      | Description                                                                                                                                                                                             |
| ------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **s**               | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to draw.                                                                                                                                                                                         |
| **font**            | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                                                                                   |
| **brush**           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)               | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the color and texture of the drawn text.                                                                    |
| **layoutRectangle** | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)             | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that specifies the location of the drawn text.                                                                  |
| **format**          | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) EndContainer(container)

Closes the current graphics container and restores the state of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the state saved by a call to the [BeginContainer](#begincontainer) method.

| Parameter     | Type                                                                                                                    | Description                                                                                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **container** | [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md) | [GraphicsContainer](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicscontainer.md) that represents the container this method restores. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points)

Fills the interior of a closed curve defined by an array of points.

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.            |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, tension)

Fills the interior of a closed curve defined by an array of points.

| Parameter   | Type                                                                        | Description                                                                                                                  |
| ----------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **points**  | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.            |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Value greater than or equal to 0.0F that specifies the tension of the curve.                                                 |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, fillMode)

Fills the interior of a closed curve defined by an array of points.

| Parameter    | Type                                                                                                  | Description                                                                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **brush**    | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)                           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                             |
| **points**   | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                             | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.                                                        |
| **fillMode** | [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) | Member of the [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) enumeration that determines how the curve is filled. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, fillMode, tension)

Fills the interior of a closed curve defined by an array of points.

| Parameter    | Type                                                                                                  | Description                                                                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **brush**    | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)                           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                             |
| **points**   | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                             | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structures that define the spline.                                                        |
| **fillMode** | [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) | Member of the [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) enumeration that determines how the curve is filled. |
| **tension**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                         | Value greater than or equal to 0.0F that specifies the tension of the curve.                                                                                             |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points)

Fills the interior of a closed curve defined by an array of points.

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.              |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, tension)

Fills the interior of a closed curve defined by an array of points.

| Parameter   | Type                                                                        | Description                                                                                                                  |
| ----------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **points**  | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.              |
| **tension** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Value greater than or equal to 0.0F that specifies the tension of the curve.                                                 |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, fillMode)

Fills the interior of a closed curve defined by an array of points.

| Parameter    | Type                                                                                                  | Description                                                                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **brush**    | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)                           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                             |
| **points**   | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)                               | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.                                                          |
| **fillMode** | [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) | Member of the [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) enumeration that determines how the curve is filled. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillClosedCurve(brush, points, fillMode, tension)

Fills the interior of a closed curve defined by an array of points.

| Parameter    | Type                                                                                                  | Description                                                                                                                                                              |
| ------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **brush**    | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)                           | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                             |
| **points**   | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)                               | Array of [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) structures that define the spline.                                                          |
| **fillMode** | [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) | Member of the [FillMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.fillmode.md) enumeration that determines how the curve is filled. |
| **tension**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                         | Value greater than or equal to 0.0F that specifies the tension of the curve.                                                                                             |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillEllipse(brush, rect)

Fills the interior of an ellipse defined by a bounding rectangle specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure.

| Parameter | Type                                                                        | Description                                                                                                                                            |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                           |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the bounding rectangle that defines the ellipse. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillEllipse(brush, rect)

Fills the interior of an ellipse defined by a bounding rectangle specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure.

| Parameter | Type                                                                          | Description                                                                                                                                              |
| --------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                             |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that represents the bounding rectangle that defines the ellipse. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillEllipse(brush, x, y, width, height)

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Width of the bounding rectangle that defines the ellipse.                                                                    |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Height of the bounding rectangle that defines the ellipse.                                                                   |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillEllipse(brush, x, y, width, height)

Fills the interior of an ellipse defined by a bounding rectangle specified by a pair of coordinates, a width, and a height.

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.                                |
| **width**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Width of the bounding rectangle that defines the ellipse.                                                                    |
| **height** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Height of the bounding rectangle that defines the ellipse.                                                                   |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPath(brush, path)

Fills the interior of a [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md).

| Parameter | Type                                                                                                          | Description                                                                                                                                     |
| --------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)                                   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                    |
| **path**  | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) that represents the path to fill. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *brush* is . -or- *path* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPie(brush, rect, startAngle, sweepAngle)

Fills the interior of a pie section defined by an ellipse specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure and two radial lines.

| Parameter      | Type                                                                        | Description                                                                                                                                                                             |
| -------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush**      | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                                            |
| **rect**       | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the bounding rectangle that defines the ellipse from which the pie section comes. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the x-axis to the first side of the pie section.                                                                                               |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the *startAngle* parameter to the second side of the pie section.                                                                              |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPie(brush, rect, startAngle, sweepAngle)

Fills the interior of a pie section defined by an ellipse specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure and two radial lines.

| Parameter      | Type                                                                          | Description                                                                                                                                                                               |
| -------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush**      | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                                                              |
| **rect**       | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that represents the bounding rectangle that defines the ellipse from which the pie section comes. |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle in degrees measured clockwise from the x-axis to the first side of the pie section.                                                                                                 |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                 | Angle in degrees measured clockwise from the *startAngle* parameter to the second side of the pie section.                                                                                |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPie(brush, x, y, width, height, startAngle, sweepAngle)

Fills the interior of a pie section defined by an ellipse specified by a pair of coordinates, a width, a height, and two radial lines.

| Parameter      | Type                                                                        | Description                                                                                                                    |
| -------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **brush**      | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.   |
| **x**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| **y**          | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| **width**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Width of the bounding rectangle that defines the ellipse from which the pie section comes.                                     |
| **height**     | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Height of the bounding rectangle that defines the ellipse from which the pie section comes.                                    |
| **startAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the x-axis to the first side of the pie section.                                      |
| **sweepAngle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Angle in degrees measured clockwise from the *startAngle* parameter to the second side of the pie section.                     |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPie(brush, x, y, width, height, startAngle, sweepAngle)

Fills the interior of a pie section defined by an ellipse specified by a pair of coordinates, a width, a height, and two radial lines.

| Parameter      | Type                                                                        | Description                                                                                                                    |
| -------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **brush**      | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.   |
| **x**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| **y**          | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the bounding rectangle that defines the ellipse from which the pie section comes. |
| **width**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Width of the bounding rectangle that defines the ellipse from which the pie section comes.                                     |
| **height**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Height of the bounding rectangle that defines the ellipse from which the pie section comes.                                    |
| **startAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Angle in degrees measured clockwise from the x-axis to the first side of the pie section.                                      |
| **sweepAngle** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Angle in degrees measured clockwise from the *startAngle* parameter to the second side of the pie section.                     |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPolygon(brush, points)

Fills the interior of a polygon defined by an array of points.

| Parameter  | Type                                                                        | Description                                                                                                                                        |
| ---------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                       |
| **points** | [PointF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)   | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) points that represent the coordinates of the corners of the polygon |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillPolygon(brush, points)

Fills the interior of a polygon defined by an array of points.

| Parameter  | Type                                                                        | Description                                                                                                                                        |
| ---------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill.                       |
| **points** | [Point\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.point)     | Array of [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) points that represent the coordinates of the corners of the polygon |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangle(brush, rect)

Fills the interior of a rectangle specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md).

| Parameter | Type                                                                          | Description                                                                                                                  |
| --------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the rectangle to fill. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangle(brush, rect)

Fills the interior of a rectangle specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md),

| Parameter | Type                                                                        | Description                                                                                                                  |
| --------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the rectangle to fill. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangle(brush, x, y, width, height)

Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **x**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The x-coordinate of the upper-left corner of the rectangle to fill.                                                          |
| **y**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The y-coordinate of the upper-left corner of the rectangle to fill.                                                          |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Width of the rectangle to fill.                                                                                              |
| **height** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Height of the rectangle to fill.                                                                                             |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangle(brush, x, y, width, height)

Fills the interior of a rectangle specified by a pair of coordinates, a width, and a height with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)

| Parameter  | Type                                                                        | Description                                                                                                                  |
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **x**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The x-coordinate of the upper-left corner of the rectangle to fill.                                                          |
| **y**      | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | The y-coordinate of the upper-left corner of the rectangle to fill.                                                          |
| **width**  | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Width of the rectangle to fill.                                                                                              |
| **height** | [Single](https://docs.microsoft.com/dotnet/api/system.single)               | Height of the rectangle to fill.                                                                                             |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *brush* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangles(brush, rects)

Fills the interiors of a series of rectangles with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md).

| Parameter | Type                                                                              | Description                                                                                                                  |
| --------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)       | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **rects** | [RectangleF\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | An array of [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) rectangles to be filled.           |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRectangles(brush, rects)

Fills the interiors of a series of rectangles with a [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md).

| Parameter | Type                                                                            | Description                                                                                                                  |
| --------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush** | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)     | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **rects** | [Rectangle\[\]](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | An array of [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) rectangles to be filled.             |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) FillRegion(brush, region)

Fills the interior of a [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md).

| Parameter  | Type                                                                          | Description                                                                                                                  |
| ---------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **brush**  | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md)   | [Brush](/system.drawing.managed/api/system.drawing/system.drawing.brush.md) that determines the characteristics of the fill. |
| **region** | [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md) | [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md) that represents the area to fill.              |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *brush* is . -or- *region* is .

### ![](/files/k27LziTvwi3FA4zj3c22) Finalize()

Finalizes an instance of the [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) class.

### ![](/files/eguYxwyd6jAtQFHRrmJW) FromImage(image)

Creates an instance of the [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) class from an existing [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md).

| Parameter | Type                                                                        | Description                                                                                                                                                                                 |
| --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image** | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) | [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md) from which to create the new [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md). |

**Returns:** [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md). This method returns a new [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) for the specified [Image](/system.drawing.managed/api/system.drawing/system.drawing.image.md).

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, width, format)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) and formatted with the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter  | Type                                                                                      | Description                                                                                                                                                             |
| ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text**   | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to measure.                                                                                                                                                      |
| **font**   | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the text format of the string.                                                   |
| **width**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | Maximum width of the string.                                                                                                                                            |
| **format** | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that represents formatting information, such as line spacing, for the string. |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified in the *text* parameter as drawn with the *font* parameter and the *format* parameter.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) *font* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, layoutArea)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) within the specified layout area.

| Parameter      | Type                                                                      | Description                                                                                                                        |
| -------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **text**       | [String](https://docs.microsoft.com/dotnet/api/system.string)             | String to measure.                                                                                                                 |
| **font**       | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) defines the text format of the string.                   |
| **layoutArea** | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef)       | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that specifies the maximum layout area for the text. |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified by the *text* parameter as drawn with the *font* parameter.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, layoutArea, stringFormat)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) and formatted with the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter        | Type                                                                                      | Description                                                                                                                                                             |
| ---------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text**         | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to measure.                                                                                                                                                      |
| **font**         | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) defines the text format of the string.                                                        |
| **layoutArea**   | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef)                       | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that specifies the maximum layout area for the text.                                      |
| **stringFormat** | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that represents formatting information, such as line spacing, for the string. |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified in the *text* parameter as drawn with the *font* parameter and the *stringFormat* parameter.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *font* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, origin, stringFormat)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) and formatted with the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter        | Type                                                                                      | Description                                                                                                                                                             |
| ---------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text**         | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to measure.                                                                                                                                                      |
| **font**         | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) defines the text format of the string.                                                        |
| **origin**       | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf)                     | [PointF](https://docs.microsoft.com/dotnet/api/system.drawing.pointf) structure that represents the upper-left corner of the string.                                    |
| **stringFormat** | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that represents formatting information, such as line spacing, for the string. |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified in the *text* parameter as drawn with the *font* parameter and the *stringFormat* parameter.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *font* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, width)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md).

| Parameter | Type                                                                      | Description                                                                                                      |
| --------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string)             | String to measure.                                                                                               |
| **font**  | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the format of the string. |
| **width** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)               | Maximum width of the string in pixels.                                                                           |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified in the *text* parameter as drawn with the *font* parameter.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *font* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md).

| Parameter | Type                                                                      | Description                                                                                                      |
| --------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string)             | String to measure.                                                                                               |
| **font**  | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) that defines the format of the string. |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size, in the units specified by the [PageUnit](#pageunit) property, of the string specified in the *text* parameter as drawn with the *font* parameter.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *font* is .

### ![](/files/gN3G3VR5GgQngV3jdnfJ) MeasureString(text, font, layoutArea, stringFormat, charactersFitted, linesFilled)

Measures the specified string when drawn with the specified [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) and formatted with the specified [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md).

| Parameter                                                                                                        | Type                                                                                      | Description                                                                                                                                                             |
| ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text**                                                                                                         | [String](https://docs.microsoft.com/dotnet/api/system.string)                             | String to measure.                                                                                                                                                      |
| **font**                                                                                                         | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md)                 | [Font](/system.drawing.managed/api/system.drawing/system.drawing.font.md) defines the text format of the string.                                                        |
| **layoutArea**                                                                                                   | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef)                       | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that specifies the maximum layout area for the text.                                      |
| **stringFormat**                                                                                                 | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) | [StringFormat](/system.drawing.managed/api/system.drawing/system.drawing.stringformat.md) that represents formatting information, such as line spacing, for the string. |
| **charactersFitted** ![](https://github.com/iceteagroup/wisej-docs-sdm/blob/NET/.gitbook/assets/badge-byref.svg) | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | Number of characters in the string.                                                                                                                                     |
| **linesFilled** ![](https://github.com/iceteagroup/wisej-docs-sdm/blob/NET/.gitbook/assets/badge-byref.svg)      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | Number of text lines in the string.                                                                                                                                     |

**Returns:** [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef). This method returns a [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef) structure that represents the size of the string, in the units specified by the [PageUnit](#pageunit) property, of the *text* parameter as drawn with the *font* parameter and the *stringFormat* parameter.

### ![](/files/gN3G3VR5GgQngV3jdnfJ) RotateTransform(angle)

Applies the specified rotation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

| Parameter | Type                                                          | Description                   |
| --------- | ------------------------------------------------------------- | ----------------------------- |
| **angle** | [Single](https://docs.microsoft.com/dotnet/api/system.single) | Angle of rotation in degrees. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) RotateTransform(angle, order)

Applies the specified rotation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) in the specified order.

| Parameter | Type                                                                                                        | Description                                                                                                                                                                                                                      |
| --------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **angle** | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                               | Angle of rotation in degrees.                                                                                                                                                                                                    |
| **order** | [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) | Member of the [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) enumeration that specifies whether the rotation is prepended or appended to the transformation matrix. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) ScaleTransform(sx, sy)

Applies the specified scaling operation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) by prepending it to the object's transformation matrix.

| Parameter | Type                                                          | Description                      |
| --------- | ------------------------------------------------------------- | -------------------------------- |
| **sx**    | [Single](https://docs.microsoft.com/dotnet/api/system.single) | Scale factor in the x direction. |
| **sy**    | [Single](https://docs.microsoft.com/dotnet/api/system.single) | Scale factor in the y direction. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) ScaleTransform(sx, sy, order)

Applies the specified scaling operation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) by prepending it to the object's transformation matrix.

| Parameter | Type                                                                                                        | Description                                                                                                                                                                                                                               |
| --------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sx**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                               | Scale factor in the x direction.                                                                                                                                                                                                          |
| **sy**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                               | Scale factor in the y direction.                                                                                                                                                                                                          |
| **order** | [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) | Member of the [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) enumeration that specifies whether the scaling operation is prepended or appended to the transformation matrix. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(rect)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the rectangle specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure.

| Parameter | Type                                                                          | Description                                                                                                                  |
| --------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **rect**  | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure that represents the new clip region. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(rect)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the rectangle specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure.

| Parameter | Type                                                                        | Description                                                                                                                |
| --------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **rect**  | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure that represents the new clip region. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(graphicsPath)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the specified [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md).

| Parameter        | Type                                                                                                          | Description                                                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **graphicsPath** | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) that represents the new clip region. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(g)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the [Clip](#clip) property of the specified [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

| Parameter | Type                                                                              | Description                                                                                                               |
| --------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **g**     | [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) | [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) from which to take the new clip region. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(rect, combineMode)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the result of the specified operation combining the current clip region and the rectangle specified by a [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure.

| Parameter       | Type                                                                                                        | Description                                                                                                                                                                            |
| --------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **rect**        | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef)                               | [RectangleF](https://docs.microsoft.com/dotnet/api/system.drawing.rectanglef) structure to combine.                                                                                    |
| **combineMode** | [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) | Member from the [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) enumeration that specifies the combining operation to use. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(rect, combineMode)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the result of the specified operation combining the current clip region and the rectangle specified by a [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure.

| Parameter       | Type                                                                                                        | Description                                                                                                                                                                            |
| --------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **rect**        | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle)                                 | [Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle) structure to combine.                                                                                      |
| **combineMode** | [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) | Member from the [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) enumeration that specifies the combining operation to use. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(graphicsPath, combineMode)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the result of the specified combining operation of the current clip region and the Clip property of the specified [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md).

| Parameter        | Type                                                                                                          | Description                                                                                                                                                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **graphicsPath** | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) | [GraphicsPath](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.graphicspath.md) to combine.                                                              |
| **combineMode**  | [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md)   | Member from the [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) enumeration that specifies the combining operation to use. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(g, combineMode)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the result of the specified combining operation of the current clip region and the [Clip](#clip) property of the specified [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

| Parameter       | Type                                                                                                        | Description                                                                                                                                                                            |
| --------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **g**           | [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md)                           | [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) that specifies the clip region to combine.                                                           |
| **combineMode** | [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) | Member from the [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) enumeration that specifies the combining operation to use. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) SetClip(region, combineMode)

Sets the clipping region of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md) to the result of the specified operation combining the current clip region and the specified [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md).

| Parameter       | Type                                                                                                        | Description                                                                                                                                                                            |
| --------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **region**      | [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md)                               | [Region](/system.drawing.managed/api/system.drawing/system.drawing.region.md) to combine.                                                                                              |
| **combineMode** | [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) | Member from the [CombineMode](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.combinemode.md) enumeration that specifies the combining operation to use. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) TranslateTransform(dx, dy)

Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

| Parameter | Type                                                          | Description                          |
| --------- | ------------------------------------------------------------- | ------------------------------------ |
| **dx**    | [Single](https://docs.microsoft.com/dotnet/api/system.single) | The x-coordinate of the translation. |
| **dy**    | [Single](https://docs.microsoft.com/dotnet/api/system.single) | The y-coordinate of the translation. |

### ![](/files/gN3G3VR5GgQngV3jdnfJ) TranslateTransform(dx, dy, order)

Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this [Graphics](/system.drawing.managed/api/system.drawing/system.drawing.graphics.md).

| Parameter | Type                                                                                                        | Description                                                                                                                                                                                                                         |
| --------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **dx**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                               | The x-coordinate of the translation.                                                                                                                                                                                                |
| **dy**    | [Single](https://docs.microsoft.com/dotnet/api/system.single)                                               | The y-coordinate of the translation.                                                                                                                                                                                                |
| **order** | [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) | Member of the [MatrixOrder](/system.drawing.managed/api/system.drawing.drawing2d/system.drawing.drawing2d.matrixorder.md) enumeration that specifies whether the translation is prepended or appended to the transformation matrix. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/system.drawing.managed/api/system.drawing/system.drawing.graphics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
