inflaterect和deflaterect

来源:互联网 发布:贝叶斯网络 编辑:程序博客网 时间:2024/06/06 15:49

DeflateRect deflates CRect by moving its sides toward its center.

 
void DeflateRect(    int x,    int y  ) throw( );void DeflateRect(    SIZE size  ) throw( );void DeflateRect(    LPCRECT lpRect  ) throw( );void DeflateRect(    int l,    int t,    int r,    int b  ) throw( );

Parameters

x

Specifies the number of units to deflate the left and right sides of CRect.

y

Specifies the number of units to deflate the top and bottom of CRect.

size

A SIZE or CSize that specifies the number of units to deflateCRect. The cx value specifies the number of units to deflate the left and right sides and thecy value specifies the number of units to deflate the top and bottom.

lpRect

Points to a RECT structure or CRect that specifies the number of units to deflate each side.

l

Specifies the number of units to deflate the left side of CRect.

t

Specifies the number of units to deflate the top of CRect.

r

Specifies the number of units to deflate the right side of CRect.

b

Specifies the number of units to deflate the bottom of CRect.

Collapse imageRemarks

To do this, DeflateRect adds units to the left and top and subtracts units from the right and bottom. The parameters ofDeflateRect are signed values; positive values deflate CRect and negative values inflate it.

The first two overloads deflate both pairs of opposite sides of CRect so that its total width is decreased by two timesx (or cx) and its total height is decreased by two timesy (or cy). The other two overloads deflate each side ofCRect independently of the others.


CRect 类中有这样的方法:

  void   DeflateRect(int   x,int   y);   
  void   DeflateRect(SIZE   size);   
  void   DeflateRect(LPCRECT   lpRect);   
  void   DeflateRect(int l, int t, int r, int b );   
参数:   
  x   指定要向左或向右移动CRect边的数量   
  y   指定要向上或向下移动CRect边的数量   
 

size   指定CRect移动数量的SIZE或CSize。   
            cx   指定移动左右边的数;   
            cy   指定移动上下边的数;  

lpRect 指向一个RECT结构或CRect,指定扩大每一边的单位数。  
l 指定扩大CRect左边的单位数。  
t 指定扩大CRect上边的单位数。  
r 指定扩大CRect右边的单位数。  
b 指定扩大CRect下边的单位数。

 

 说明:   DeflateRect   通过朝它的中心移动边以缩小CRect(从边框向内部缩小)


0 0