Esempio n. 1
0
        private CoordPoint SrceenToGeo(PointF pt, ICoordinateTransform coordTran)
        {
            double prjX = 0, prjY = 0;
            double geoX = 0, geoY = 0;

            coordTran.Screen2Prj(pt.X, pt.Y, out prjX, out prjY);
            coordTran.Prj2Geo(prjX, prjY, out geoX, out geoY);
            return(new CoordPoint(geoX, geoY));
        }
Esempio n. 2
0
 private void ToRasterPointF(ref PointF pt, ICanvas canvas)
 {
     ICoordinateTransform coordTran = canvas.CoordTransform;
     //if (canvas.PrimaryDrawObject != null)//有活动影像是返回栅格坐标
     //{
     //    float row = 0, col = 0;
     //    coordTran.Screen2Raster(pt.X, pt.Y, out row, out col);
     //    pt.X = col;
     //    pt.Y = row;
     //}
     //else//无活动影像时返回投影坐标
     {
         double prjX = 0, prjY = 0;
         coordTran.Screen2Prj(pt.X, pt.Y, out prjX, out prjY);
         pt.X = (float)prjX;
         pt.Y = (float)prjY;
     }
 }
Esempio n. 3
0
        private PixelInfo GetPixelInfo(ICanvas canvas, int screenX, int screenY)
        {
            ICoordinateTransform coordTran = canvas.CoordTransform;
            PixelInfo            pInfo     = new PixelInfo();

            pInfo.ScreenX = screenX;
            pInfo.ScreenY = screenY;
            if (canvas.IsReverseDirection)
            {
                IReversedCoordinateTransform tran = canvas as IReversedCoordinateTransform;
                tran.Screen2Prj(screenX, screenY, out pInfo.PrjX, out pInfo.PrjY);
                tran.Screen2Raster((float)screenX, (float)screenY, out pInfo.RasterY, out pInfo.RasterX);
            }
            else
            {
                coordTran.Screen2Prj(screenX, screenY, out pInfo.PrjX, out pInfo.PrjY);
                coordTran.Screen2Raster((float)screenX, (float)screenY, out pInfo.RasterY, out pInfo.RasterX);
            }
            //coordTran.Prj2Geo(pInfo.PrjX, pInfo.PrjY, out pInfo.GeoX, out pInfo.GeoY);
            return(pInfo);
        }