阅读:1357回复:2
c#+mo的问题
<P>求助!在c#+mo中怎样计算地图比例尺???</P>
|
|
1楼#
发布于:2006-06-11 14:17
public class Scale<BR> {<BR> private const double INCH2METERS = 39.37; <BR> public Scale()<BR> { <BR> }<BR> public string updateScale(ESRI.MapObjects2.Core.AxMap axMap)<BR> {<BR> string strMapScale;<BR> double mapScreenWidth;<BR> double mapExtentWidth;<BR> double mapScale;<BR> double convFactor=INCH2METERS;<BR> if(axMap.Layers.Count==0)<BR> { <BR> return null;<BR> }<BR> mapScreenWidth = axMap.Width / 72;<BR> mapExtentWidth = axMap.Extent.Width * convFactor;<BR> mapScale = Convert.ToInt32(mapExtentWidth / mapScreenWidth);<BR> strMapScale = "比例尺 1 : " +mapScale.ToString(); <BR> return strMapScale;<BR> }
|
|
2楼#
发布于:2006-06-27 12:55
请教:axMap.Width/72 ------- 为什么要“/72”呢?<img src="images/post/smile/dvbbs/em02.gif" />
|
|
|