超图FAQ: 无界面出图,需要设置地图的ImageSize 属性,这个参数是设置图片的大小;默认的是255*255,但是当设置的地图范围不是一个正方形范围的时候,就需要去计算出图比例;
比如要将地图的rectangle2D范围内的地图输出为图片;
Rectangle2D rectangle2D = new Rectangle2D(118.905029296875, 32.4356130411628, 118.916015625, 32.4448849671671);
double bl = (118.916015625 - 118.905029296875) / (32.4448849671671 - 32.4356130411628);
double imagesizey = 255 / bl;
map.ImageSize = new Size(255,Convert.ToInt32 (imagesizey));
map.ViewBounds = re;
map.OutputMapToPNG(picturepath, true);