本人小白,最近看了点数字图像的书,为了便于图像的分析,希望把这幅图像的数据信息显示在状态栏上,但显示的时候却出了问题:我想让gray的值为该副图片的灰度值,可这个结果显然是不对的。先贴出在Mousemove消息下的代码如下,希望各位大神帮忙看下哪里出错了 ,感激不尽
void CImageProcessView::OnMouseMove(UINT nFlags, CPoint point)
{
CClientDC dc(this);
COLORREF gray=dc.GetPixel(point);
CString str;
str.Format("x=%d,y=%d,gray=%d",point.x,point.y,gray);
((CMainFrame*) GetParent())->m_wndStatusBar.SetWindowText(str);
}