高手们帮帮忙,为什么我用GetPixel出这种怪事!◎!
void C10Dlg::OnGet
{
// TODO: Add your control notification handler code here
::GetCursorPos(&Point);
HDC pDC =::GetDC((HWND)h_wnd);
clr1=::GetPixel(pDC,Point.x,Point.y);
}
Point和clr1都是全局变量,然后调用
void C10Dlg::OnBUTTONt()
{
// TODO: Add your control notification handler code here
COLORREF clr3;
HDC pDC =::GetDC((HWND)h_wnd);
clr3=::GetPixel(pDC,Point.x,Point.y);
CString m3;
m3.Format("c3=%d",GetRValue(clr3));
AfxMessageBox(m3);
}
我要考察的点颜色都已经变化了的,但得到的clr3和clr1还是一样的?不知道哪里出问题了.谢谢!