public LongLat[] GetMapCornersLongLat() { var swPixel = new PointD(0, Map.Image.Height); var nePixel = new PointD(Map.Image.Width, 0); var sePixel = new PointD(nePixel.X, swPixel.Y); var nwPixel = new PointD(swPixel.X, nePixel.Y); var inverseAverageTransformationMatrix = Sessions.CalculateAverageTransformation().TransformationMatrix.Inverse(); return(new[] { GetLongLatForMapImagePosition(swPixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(nwPixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(nePixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(sePixel, inverseAverageTransformationMatrix) }); }
public LongLat[] GetImageCornersLongLat(Rectangle imageBounds, Rectangle mapBounds, double zoomValue) { var swPixel = new PointD(0, Map.Image.Height) + new PointD(imageBounds.Left - mapBounds.Left, imageBounds.Bottom - mapBounds.Bottom) / zoomValue; var nePixel = new PointD(Map.Image.Width, 0) + new PointD(imageBounds.Right - mapBounds.Right, imageBounds.Top - mapBounds.Top) / zoomValue; var sePixel = new PointD(nePixel.X, swPixel.Y); var nwPixel = new PointD(swPixel.X, nePixel.Y); var inverseAverageTransformationMatrix = Sessions.CalculateAverageTransformation().TransformationMatrix.Inverse(); return(new[] { GetLongLatForMapImagePosition(swPixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(nwPixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(nePixel, inverseAverageTransformationMatrix), GetLongLatForMapImagePosition(sePixel, inverseAverageTransformationMatrix) }); }