勇芳软件工作室.汉化:  Rectangles > Rectangle Structures >

RECT

Previous pageReturn to chapter overviewNext page

描述

 

RECT结构定义了矩形左上角和右下角的坐标。

 

C++ 语法

 

typedef struct _RECT {

LONG left;

LONG top;

LONG right;

LONG bottom;

} RECT,

*PRECT;

 

PowerBASIC 语法

 

宣布为联合解决不同用途的问题。

 

TYPE OLD_RECT_STRUCT DWORD   ' Old PB definition

  nLeft   AS LONG   ' LONG left

  nTop    AS LONG   ' LONG top

  nRight  AS LONG   ' LONG right

  nBottom AS LONG   ' LONG bottom

END TYPE

 

' // Size = 16 bytes

TYPE tagRECT DWORD

  Left   AS LONG   ' LONG left

  Top    AS LONG   ' LONG top

  Right  AS LONG   ' LONG right

  Bottom AS LONG   ' LONG bottom

END TYPE

 

' // GDI+ uses x, y, Width and Height as members instead of Left, Right, Top and Bottom

TYPE GDIP_RECT_STRUCT DWORD

  x      AS LONG   ' LONG x

  y      AS LONG   ' LONG y

  Width  AS LONG   ' LONG Width

  Height AS LONG   ' LONG Height

END TYPE

 

' // To allow the use of both nLeft, etc, and Left, etc.

' // Size = 16 bytes

UNION RECT

  OLD_RECT_STRUCT

  tagRECT

  GDIP_RECT_STRUCT

END UNION

 

成员

 

left

 

指定矩形左上角的x坐标。

 

top

 

指定矩形左上角的y坐标。

 

right

 

指定矩形右下角的x坐标。

 

bottom

 

指定矩形右下角的y坐标。

 

备注

 

按照惯例,矩形的右边和底边通常被认为是排他的。换句话说,坐标为(底部)的像素立即位于矩形的外侧。例如,当RECT传递给FillRect函数时,矩形将填充到但不包括右列和最下一行像素。该结构与RECTL结构相同。

 

引用文件 #INCLUDE Once

 

WinDef.inc