根据代码解释dc.MoveTo和dc.LineTo函数的实际意义

为了画灰度直方图:

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

dc.MoveTo(i,clientRect.bottom);

//将画笔移动到A点,位置靠MoveTo接受的两个参数确定
dc.LineTo(i,clientRect.bottom-*(bufTemp+i-clientRect.left));

//将画笔从当前的位置画到B点,B点的位置靠LineTo接受的2个参数确定
温馨提示:答案为网友推荐,仅供参考