为了画灰度直方图:
DWORD *bufTemp=NULL;
bufTemp=new DWORD[m_SectionNum];
//m_SectionNum指划分的等级数目
double
x=clientRect.Height();
for(i=0;i<m_SectionNum;i++)
{
*(bufTemp+i)=(unsigned
long)((float)(*(p_NumPerSection+i))*x/maxNumOneSect);
//*(p_NumPerSection+i)是每个级别所含的像素数,maxNumOneSect指所含像素数最多的某级别的像素数量
}
for(i=clientRect.left;i<=clientRect.right;i++)
{
dc.MoveTo(i,clientRect.bottom);
//【重点解释这两句,谢谢。】
dc.LineTo(i,clientRect.bottom-*(bufTemp+i-clientRect.left));