System::Drawing::Graphics::DrawRectangle 方法

Graphics::DrawRectangle(const SharedPtr<Pen>&, float, float, float, float) method

在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, float x, float y, float width, float height)
参数类型描述
const SharedPtr<Pen>&绘制矩形时使用的笔
xfloat要绘制的矩形左上角的 X 坐标
yfloat要绘制的矩形左上角的 Y 坐标
widthfloat要绘制的矩形的宽度
heightfloat要绘制的矩形的高度

另见

Graphics::DrawRectangle(const SharedPtr<Pen>&, int, int, int, int) method

在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, int x, int y, int width, int height)
参数类型描述
const SharedPtr<Pen>&绘制矩形时使用的笔
xint要绘制的矩形左上角的 X 坐标
yint要绘制的矩形左上角的 Y 坐标
widthint要绘制的矩形的宽度
heightint要绘制的矩形的高度

另见

Graphics::DrawRectangle(const SharedPtr<Pen>&, Rectangle) method

在当前对象所表示的表面上使用指定的笔绘制指定的矩形。

void System::Drawing::Graphics::DrawRectangle(const SharedPtr<Pen> &pen, Rectangle rect)
参数类型描述
const SharedPtr<Pen>&绘制矩形时使用的笔
rectRectangle一个 Rectangle 对象,指定要绘制的矩形的位置和大小

另见