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);
}
}
本文深入探讨了RGNDATA和hrgn在图形处理中的应用,详细解释了如何通过RGNDATA直接调用hrgn进行数据保存,并展示了获取并绘制区域中矩形的方法。
1300

被折叠的 条评论
为什么被折叠?



