Graphics.DrawRectangle
DrawRectangle(Pen, RectangleF)
Draws a rectangle specified by a RectangleF structure.
public void DrawRectangle(Pen pen, RectangleF rect)
| Parameter | Type | Description |
|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| rect | RectangleF | A RectangleF structure that represents the rectangle to draw. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | pen is null. |
See Also
DrawRectangle(Pen, Rectangle)
Draws a rectangle specified by a Rectangle structure.
public void DrawRectangle(Pen pen, Rectangle rect)
| Parameter | Type | Description |
|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| rect | Rectangle | A Rectangle structure that represents the rectangle to draw. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | pen is null. |
See Also
DrawRectangle(Pen, float, float, float, float)
Draws a rectangle specified by a coordinate pair, a width, and a height.
public void DrawRectangle(Pen pen, float x, float y, float width, float height)
| Parameter | Type | Description |
|---|
| pen | Pen | A Pen that determines the color, width, and style of the rectangle. |
| x | Single | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Single | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Single | The width of the rectangle to draw. |
| height | Single | The height of the rectangle to draw. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | pen is null. |
See Also
DrawRectangle(Pen, int, int, int, int)
Draws a rectangle specified by a coordinate pair, a width, and a height.
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
| Parameter | Type | Description |
|---|
| pen | Pen | Pen that determines the color, width, and style of the rectangle. |
| x | Int32 | The x-coordinate of the upper-left corner of the rectangle to draw. |
| y | Int32 | The y-coordinate of the upper-left corner of the rectangle to draw. |
| width | Int32 | Width of the rectangle to draw. |
| height | Int32 | Height of the rectangle to draw. |
Exceptions
| exception | condition |
|---|
| ArgumentNullException | pen is null. |
See Also