现在我有一个局部坐标的一些点的x,y值,
要将其转换为整体坐标的x,y值,请问该用什么函数来实现这一功能。
谢谢!

解决方案 »

  1.   

    MFC Library Reference   CWnd::ClientToScreen 
    Converts the client coordinates of a given point or rectangle on the display to screen coordinates.void ClientToScreen(
       LPPOINT lpPoint 
    ) const;
    void ClientToScreen(
       LPRECT lpRect 
    ) const;
    Parameters
    lpPoint 
    Points to a POINT structure or CPoint object that contains the client coordinates to be converted. 
    lpRect 
    Points to a RECT structure or CRect object that contains the client coordinates to be converted. 
    Res
    The ClientToScreen member function uses the client coordinates in the POINT or RECT structure or the CPoint or CRect object pointed to by lpPoint or lpRect to compute new screen coordinates; it then replaces the coordinates in the structure with the new coordinates. The new screen coordinates are relative to the upper-left corner of the system display. The ClientToScreen member function assumes that the given point or rectangle is in client coordinates.Example
    // resize dialog to client's size
    void CAboutDlg::OnButton1() 
    {
       CRect myRect;
       GetClientRect(&myRect);   ClientToScreen(myRect);
       MoveWindow(myRect.left, myRect.top,
          myRect.Width(), myRect.Height());
    }
    See Also
    CWnd Overview | Class Members | Hierarchy Chart | CWnd::ScreenToClient | ClientToScreen
      

  2.   

    ClientToScreen  将客户区的坐标转换成整个屏幕的坐标。
    ScreenToClietn  恰恰相反