Below is the code for calculating the number of pixel inside CRgn
int nNumberOfPixel = 0;
int nSize = m_pROIRgn->GetRegionData(NULL, NULL);
if(nSize)
{
RGNDATA * pRegion = (RGNDATA *) new char[nSize];
m_pROIRgn->GetRegionData(pRegion, nSize);
const RECT* pRect = (const RECT *) & pRegion->Buffer;
int rectcount = pRegion->rdh.nCount;
for(int i = 0; i < rectcount; i++)
{
nNumberOfPixel = nNumberOfPixel + ((pRect[ i ].right - pRect[ i ].left) * (pRect[ i ].bottom - pRect[ i ].top));
}
delete [] (char *) pRegion;
}
Thanks CPallini and YDaoust for help.