现在的位置: 首页 > 综合 > 正文

crgn相关

2012年01月13日 ⁄ 综合 ⁄ 共 693字 ⁄ 字号 评论关闭

crgn直接调用的hrgn,

具体保存数据的是

typedef struct _RGNDATAHEADER
    {
    DWORD dwSize;
    DWORD iType;
    DWORD nCount;
    DWORD nRgnSize;
    RECT rcBound;
    } RGNDATAHEADER;

typedef struct _RGNDATA
    {
    RGNDATAHEADER rdh;
    char Buffer[ 1 ];
    } RGNDATA;

这里面保存了很多的rect

::GetRegionData(hBreakRgn,   dwSize,   (RGNDATA*)pData); 
//C:   Get   the   number   of   rectangles   contained   in   the   Region. 
RGNDATA   *prData   =   (RGNDATA*)pData; 
RECT         *prRectangles   =   (RECT*)prData-> Buffer; 
UINT   nCount   =   prData-> rdh.nCount; 
//C:   Paint   each   rectangle   in   the   region   with   an   alternating   brush   color. 
UINT   index   =   0; 
for   (;index   <   nCount;   index++) 

if   (index   %   2) 

dc.FillRect(&prRectangles[index],   brBreakA); 

else 

dc.FillRect(&prRectangles[index],   brBreakB); 


抱歉!评论已关闭.