public IRectangle GetRectPixels(int _scale, IRectangleD _rect) { //_rect is in the coordinate system of the image, in this case mercator spherical projection GlobalMercator p = new GlobalMercator(); //reverse the scale values (Manifold goes the opposite way to TMS / Google / Microsoft) Int32 zoom = ScaleHi - _scale; Point ptLB = p.GetPixels(new PointD(_rect.XMin, _rect.YMin), zoom); Point ptRT = p.GetPixels(new PointD(_rect.XMax, _rect.YMax), zoom); // bottom-left pixel is at (0, 0) return(new Rectangle(Convert.ToInt32(ptLB.X), Convert.ToInt32(ptLB.Y), Convert.ToInt32(ptRT.X), Convert.ToInt32(ptRT.Y))); }
public void init() { globalMercator = new GlobalMercator(); latitudeLongitudePoint = new PointD(143.068055770704, -38.4537515036619); mercatorPoint = new PointD(15926263.117, -4643725.484); }
public IRectangle GetRectPixels(int _scale, IRectangleD _rect) { //_rect is in the coordinate system of the image, in this case mercator spherical projection GlobalMercator p = new GlobalMercator(); //reverse the scale values (Manifold goes the opposite way to TMS / Google / Microsoft) Int32 zoom = ScaleHi - _scale; Point ptLB = p.GetPixels(new PointD(_rect.XMin, _rect.YMin), zoom); Point ptRT = p.GetPixels(new PointD(_rect.XMax, _rect.YMax), zoom); // bottom-left pixel is at (0, 0) return new Rectangle(Convert.ToInt32(ptLB.X), Convert.ToInt32(ptLB.Y), Convert.ToInt32(ptRT.X), Convert.ToInt32(ptRT.Y)); }