ScreenToClient和ClientToScreen都假定坐标是设备坐标。 在EX05C中(EX05C是一个例子程序,只需看函数中的代码即可): 我们现在来看看逻辑坐标和物理坐标是怎么转换的。 void CEX05CView::OnInitialUpdate() { CScrollView::OnInitialUpdate(); // TODO: calculate the total size of this view CSize sizeTotal(800...
CDC::LPtoDP void LPtoDP( LPPOINT lpPoints, int nCount = 1 ) const;void LPtoDP( LPRECT lpRect ) const;void LPtoDP( LPSIZE lpSize ) const;Parameters lpPoints Points to an array of points. Each point in the array is a POINT structure or a CPoint object.nCount The number o...
你可以 把转换后的 座标 TRACE 到调试窗口,看转换是否起作用。如果起作用,那就是你的 更新状态栏 的代码有问题了。void CDATAView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CClientDC dc(this); //获取设备 ...