开发者

MFC GetClientRect/GetWindowRect after a MoveWindow

开发者 https://www.devze.com 2023-02-22 16:32 出处:网络
m_PICTURE_OD is an IDC_STATIC, m_PICTURE_开发者_如何学GoOD.MoveWindow(640 /*x*/,96/*y*/,480/*w*/,288/*h*/);

m_PICTURE_OD is an IDC_STATIC,

m_PICTURE_开发者_如何学GoOD.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;

I'd like to reobtain myrect.left = 640, myrect.top = 96 ...

What can I do ?

Thanks,


You are mixing screen coordinates and client coordinates. To translate between them, use CWnd::ScreenToClient and CWnd::ClientToScreen.

0

精彩评论

暂无评论...
验证码 换一张
取 消