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);
}
}