勇芳软件工作室.汉化:  Filled Shapes > Filled Shapes Functions >

Rectangle

Previous pageReturn to chapter overviewNext page

描述

 

长方形函数绘制一个矩形。使用当前笔并使用当前画笔填充矩形。

 

C++ 语法

 

BOOL Rectangle(

__in HDC hdc,

__in int nLeftRect,

__in int nTopRect,

__in int nRightRect,

__in int nBottomRect

);

 

PowerBASIC 语法

 

FUNCTION Rectangle ( _

BYVAL hdc AS DWORD, _

BYVAL nLeftRect AS LONG, _

BYVAL nTopRect AS LONG, _

BYVAL nRightRect AS LONG, _

BYVAL nBottomRect AS LONG _

) AS LONG

 

参数

 

hdc

 

[in]处理设备上下文。

 

nLeftRect

 

[in]指定矩形左上角的逻辑坐标中的x坐标。

 

nTopRect

 

[in]指定矩形左上角的逻辑坐标中的y坐标。

 

nRightRect

 

[in]指定矩形右下角的逻辑坐标中的x坐标。

 

nBottomRect

 

[in]指定矩形右下角的逻辑坐标中的y坐标。

 

返回值

 

如果函数成功,返回值不为零。

 

如果函数失败,返回值为零。

 

Windows NT / 2000 / XP / Vista / Windows 7:要获取扩展错误信息,请调用GetLastError.

 

备注

 

当前位置既不使用也不由长方形更新。

 

绘制的矩形不包括底边和右边。

 

如果使用了PS_NULL笔,则矩形的尺寸为1像素,宽度为1像素。

 

引用文件 #INCLUDE Once

 

WinGdi.inc(包括Windows.inc)