RGNDATA结构
RGNDATA结构具有如下形式:
typedef struct _RGNDATA
{
/* rgnd */
RGNDATAHEADER rdh;
char Buffer[1];
} RGNDATA;
RGNDATA 结构中包含了一个头和一个矩形数组,组成了一个区域。这些矩形从左到右、从上到下排列,没有重叠。
RGNDATA:
RGNDATA * pRgnD; // 参数
int nRect;
nRect = slabRgn.GetRegionData(NULL, 0); // first call: get size of data in bytes
pRgnD = (RGNDATA *) new char[nRect]; // allocate the needed space
CRect * pRect = (CRect* ) &pRgnD->Buffer;
nRect = slabRgn.GetRegionData(pRgnD, nRect); // this is the real call, gets the data
slabRgn是CRgn类对象,对本不规则区域进行裁切.
Buffer 指定了任意大小的缓冲区,其中包含了组成区域的RECT结构.
pRect是最后裁剪得到的一系列举行列表。