private void PrintInfos(Point location) { if (_infoPrinters == null || _infoPrinters.Count == 0) { return; } Point prjPt = location; _coordTransfrom.PixelCoord2PrjCoord(ref prjPt); PointF geoPt = prjPt; _coordTransfrom.PrjCoord2GeoCoord(ref geoPt); foreach (IMouseLocationInfoPrinter printer in _infoPrinters) { printer.Print(this, location.X, location.Y, prjPt.X, prjPt.Y, geoPt.X, geoPt.Y); } }
private Envelope ToGeoEnvelope(IMapRuntime runtime, Envelope currentExtent) { ICoordinateTransform coord = runtime as ICoordinateTransform; ShapePoint[] pts = currentExtent.Points; coord.PrjCoord2GeoCoord(pts); double minX = double.MaxValue; double minY = double.MaxValue; double maxX = double.MinValue; double maxY = double.MinValue; foreach (ShapePoint pt in pts) { if (pt.X < minX) { minX = pt.X; } if (pt.Y < minY) { minY = pt.Y; } if (pt.X > maxX) { maxX = pt.X; } if (pt.Y > maxY) { maxY = pt.Y; } } Envelope envelope = new Envelope(); envelope.MinX = minX; envelope.MinY = minY; envelope.MaxX = maxX; envelope.MaxY = maxY; return(envelope); }