public Path AddRectangle(
float x,
float y,
float width,
float height
)
Public Function AddRectangle (
x As Single,
y As Single,
width As Single,
height As Single
) As Path
public:
Path^ AddRectangle(
float x,
float y,
float width,
float height
)
member AddRectangle :
x : float32 *
y : float32 *
width : float32 *
height : float32 -> Path
The rectangle is added as a new closed figure.
When filling a rectangle (with identity transformation), the width and height parameters specify the size of the rectangle in pixels.
When drawing a rectangle (with identity transformation), the right and bottom values are inclusive. If the width of the Pen is 1, a rectangle with zero width and height will be rendered as a single pixel.
The parameters are not validated here but in the moment of drawing the coordinates of the possibly transformed path points must fall into the bounds of an int value; otherwise, an OverflowException will be thrown.