Skip to main content
GameDev.net gamedev.net
🔒 Locked

MFC- GetPixel doesn't work!!!

Started by CuteBug May 8, 2003 at 2:55 AM 0 replies 1k views
Original Post
CuteBug
CuteBug
In an SDI application I created a new Class, say, CTest. In one of the member functions of CTest I included the following code -
void CTest::SomeFunc(...)
{
  ...
     int x;
     int y;
  
  ...
  
  CFrameWnd* pFrame = (CFrameWnd*)(AfxGetApp()->m_pMainWnd);
  CMyAppView* pView = (CMyAppView*)(pFrame->GetActiveView());

  CClientDC dc(pView);

  COLORREF pix = dc.GetPixel(x, y);

  ...
}
 
But the function GetPixel doent return the correct value of the the pixel color at (x,y); when I debugged it pix always had the value 0xffffffff. Please help... "There is a Bug in every Code!"
"There is a Bug in every Code!"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.