Share via


RECT 結構

RECT 結構定義矩形的左上角和右下角的座標。

typedef struct tagRECT { 
   LONG left; 
   LONG top; 
   LONG right; 
   LONG bottom; 
} RECT;

成員

  • left
    指定矩形左上角的 x 座標。

  • top
    指定矩形左上角的 y 座標。

  • right
    指定矩形右下角的 x 座標。

  • bottom
    指定矩形右下角的 y 座標。

範例

//Alternate ways to intialize a RECT structure:

RECT rctA;
rctA.left = 20;  
rctA.top = 30;  
rctA.right  = 180;  
rctA.bottom = 230;

RECT rctB = {20,30,180,230};   

需求

標頭 : windef.h

請參閱

參考

CRect Class

其他資源

結構、樣式、回呼和訊息對應