私はこのコードに出くわしました:
//handler for context menu element; to move an element
void CRTS_SketcherView::OnElementMove()
{
CClientDC aDC(this);
OnPrepareDC(&aDC); //Set up the device context
GetCursorPos(&m_CursorPos); //Get cursor position in screen coords
ScreenToClient(&m_CursorPos); //convert to client coords
aDC.DPtoLP(&m_CursorPos); //Convert to logical
// ...code to initialize the moving of a shape on screen
}
カーソルの画面座標は画面上の位置であり、クライアント座標はウィンドウの位置に関係なく、ウィンドウのクライアント領域の座標であることを知っています。では、デバイス座標とは何でしょう? 私が知っている唯一のことは、それらがピクセル単位であることですが、論理(クライアント)および画面座標にどのように接続されていますか?