移动窗口后的MFC GetClientRect/GetWindowRect
m_PICTURE_OD是一个IDC_STATIC移动窗口后的MFC GetClientRect/GetWindowRect,mfc,getclientrect,Mfc,Getclientrect,m_PICTURE_OD是一个IDC_STATIC m_PICTURE_OD.MoveWindow(640 /*x*/,96/*y*/,480/*w*/,288/*h*/); RECT myrect; m_PICTURE_OD.GetClientRect(&myrect); myrect.bottom=288; myrect.top=0; myrect.left=0; myrect.right=480 RECT myrect; m_PICTURE_OD.GetWindowRect(&a
m_PICTURE_OD.MoveWindow(640 /*x*/,96/*y*/,480/*w*/,288/*h*/);
RECT myrect;
m_PICTURE_OD.GetClientRect(&myrect);
myrect.bottom=288;
myrect.top=0;
myrect.left=0;
myrect.right=480
RECT myrect;
m_PICTURE_OD.GetWindowRect(&myrect);
myrect.bottom=508;
myrect.top=220;
myrect.left=802;
myrect.right=1282
我想重新获得myrect.left=640,myrect.top=96
我能做什么
谢谢,您正在混合屏幕坐标和客户端坐标。要在它们之间进行转换,请使用
CWnd::ScreenToClient
和CWnd::ClientToScreen