chen1106
路人甲
路人甲
  • 注册日期2006-01-13
  • 发帖数7
  • QQ
  • 铜币129枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1357回复:2

c#+mo的问题

楼主#
更多 发布于:2006-06-09 02:05
<P>求助!在c#+mo中怎样计算地图比例尺???</P>
喜欢0 评分0
wjckaxi
路人甲
路人甲
  • 注册日期2004-04-13
  • 发帖数144
  • QQ
  • 铜币149枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2006-06-27 12:55
请教:axMap.Width/72   ------- 为什么要“/72”呢?<img src="images/post/smile/dvbbs/em02.gif" />
菜虫 欢迎光临Blog http://blog.sina.com.cn/wjckaxi
举报 回复(0) 喜欢(0)     评分
gisgeoboy
路人甲
路人甲
  • 注册日期2003-11-11
  • 发帖数73
  • QQ
  • 铜币377枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于: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>         }
举报 回复(0) 喜欢(0)     评分
游客

返回顶部