你说的就是屏幕坐标和地图坐标转换吧;
//屏幕坐标转地图坐标:
UGPoint2D MapControl::PixelToMap(UGPoint pt)
{
UGPoint2D pntlp;
UGPoint2D pnt2D(0.0, 0.0);
//DP -> LP -> MP
UGDrawing *pDrawing = m_pUGMapWnd->m_mapWnd.m_Map.GetDrawing();
m_pUGMapWnd->m_mapWnd.m_Map.GetDrawing()->m_DrawCache.DPtoLP(&pt, &pntlp, 1);
pDrawing->m_DrawParam.LPtoMP(pntlp, pnt2D);
return pnt2D;
}
//地理坐标转屏幕坐标:
UGPoint MapControl::MapToPixel(UGPoint2D pnt)
{
UGPoint2D pntlp;
UGPoint pt(0, 0);
// MP -> LP -> DP
UGDrawing *pDrawing = m_pUGMapWnd->m_mapWnd.m_Map.GetDrawing();
pDrawing->m_DrawParam.MPtoLP(pnt, pntlp);
m_pUGMapWnd->m_mapWnd.m_Map.GetDrawing()->m_DrawCache.LPtoDP(&pntlp, &pt, 1);
return pt;
}