More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  外热忱棵的家PhotosProfileFriendsMore Tools Explore the Spaces community

外热忱棵的家

7/4/2008

1厘米等于多少个像素

客户要求地图显示的时候显示的是一比多少的地图,于是会设计到这个问题。

网上的答案都是这个问题是错误的之类的答案,或者就是1厘米等于25像素。
我知道这个问题和屏幕的尺寸有关,因为我的显示器上1厘米大概为三十多个像素。
为了一探究竟于是有了以下计算。

假设前提:
a. 1英寸是25.4毫米
b. 19英寸的屏幕表示的是显示器对角线的长度是19英寸
c. 显示器分辨率为1024*768
d. 显示器横向单位像素所占距离和纵向单位像素所占距离相同


具体计算:
1. 19英寸的屏幕
我用的正好是19寸宽屏液晶显示器
给你量量!宽41.2厘米高大概有26厘米!

 

首先计算显示器的长和宽:
19英寸 = 482.6毫米
1024*768
设宽为w,高为h
则w:h=1024:768=4:3
w=(1024/768)h = (4/3)h
w^2+h^2 = (482.6)^2
(16/9+1) * h^2 = 232902.76 mm^2
(25/9) * h^2 = 232902.76 mm^2
h^2 = 83844.9936 mm^2
h .= 289.56 mm
w .= 386.08 mm

1 像素 = (386.08/1024) mm .= 0.377031 mm
1 mm .= 2.6523 像素
1 厘米 .= 27 像素

 


2. 15英寸的屏幕
15英寸 = 381.0毫米
(16/9+1) * h^2 = 145161.00 mm^2
h^2 = 52257.96 mm^2
h = 228.6 mm
w = 304.8 mm
1 像素 = (304.8/1024) mm .= 0.29765625 mm
1 mm .= 3.3595800524934383202099737532808
1 厘米 .= 34 像素

3. N英寸的屏幕
N英寸 = 25.4 * N mm
(25/9) * h^2 = (25.4*N)^2 mm^2
h^2 = 25.4^2 * N^2 * 9/25 mm
h = 25.4 * N * 3/5 mm
  = 15.24 * N mm
w = 20.32 * N mm
1像素 = (20.32 * N / 1024) mm = (0.01984375 * N) mm
1mm = (50.3937007 / N) 像素
1厘米 = (503.937007 / N) 像素

4. 几个常见的N值
15英寸:1 厘米 = 34 像素
17英寸:1 厘米 = 30 像素
19英寸:1 厘米 = 27 像素
20英寸:1 厘米 = 25 像素
22英寸:1 厘米 = 23 像素


 

7/3/2008

关于图例的显示

下午在研究如何显示图例,发现主要需要用到Legend这个类,但每次显示出来时图片均太小了。
试了半天发现需使用setAutoExtend()这个方法设置以下。

以下为相关代码:
    /**
     * 刷新地图
     */
    public void mapRefresh() {
        Legend legend = map.getLegend();
        legend.setAutoExtend(true);
        //legend.setLayerFontSize(10);

        map.refresh();

        ServerParameter.setLegendUrl(legend.getLegendOutput().getURL());
        ServerParameter.setMapUrl(map.getMapOutput().getURL());
    }

网页部分的代码
    //图例
    if(inTool.id == "legend")
    {
        //弹出一个输入城市名称的页面
        var strLegendURL = ("legend.jsp?imageURL=" + parent.parent.STR_LEGEND_URL);
        var urlLegendProperties = "dialogHeight: 500px; dialogWidth: 300px;" +
            "edge: Raised; center: Yes; help: no; resizable: Yes; " +
            "status: no; Minimize: yes; Maximize: no";

        window.showModalDialog(strLegendURL, this, urlLegendProperties);
    }

以下为显示效果:
legend


另外昨天晚上发现了R1979的一个36位的素因子:
924460209395849459223245399754052787

7/1/2008

修改IE7的默认页面

不小心安装了IE7,每次都打开微软自己的那个页面,通过“工具” -> “Internet 选项”中的“主页”项改了半天都没改过来。实在不懂微软为什么一定要这样做,最后还是在网上找到了一篇介绍修改默认页面的方法。
 
在安装IE7后,IE7将默认打开微软的网站相关的页面进行自定义设置。这样一些没有上互联网的内部网用户将无法正常显示自定义的默认首页。要解决这个问题,可以通过修改组策略来实现。依次打开“开始->运行->gpedit.msc->管理模板->Windows Compoents->Internet Explorer->阻止执行首次运行自定义设置”,选择“已启用”项,在“选择您的选择”下拉列表中选择“直接转到主页”。重新启动IE7。
有些版本并没有组策略编辑器,或者你看看服务中是不是将Group Policy服务关闭了,这个服务要启动才能调整组策略!
 
 
6/29/2008

some error messages

2008-06-24 11:50    java.lang.OutOfMemoryError: Java heap space
2008-06-24 16:55    fnfe=java.io.FileNotFoundException: jcyq.cfg (系统找不到指定的文件。)
2008-06-26 11:57    Connection timed out: connect
2008-06-26 11:57    File "null" not found.
2008-06-29 21:20    java.lang.ClassCastException: com.esri.aims.mtier.model.map.layer.ImageLayer
2008-07-04 10:04    [ERR0503] Query failed.  Check 'where' clause for valid syntax and field names and that layer ID is correct.
 
6/28/2008

用VML给地图添加比例尺

在HTML页面中添加如下代码:
<!-- 比例尺 -->
<div id="scaleBar" style="font-weight:bold;position:absolute; overflow:hidden; right:50px; bottom:0px; width:100px; height:25px;">
比例尺
</div>
<v:polyline points='0,95 0,100 100,100 100,95' style='position:absolute;z-index:2100;right:50;bottom:0;' strokecolor='#000000' strokeweight='2' filled='true'>
    <v:stroke StartArrow='' EndArrow='' dashstyle='Line' />
</v:polyline>
其中scaleBar用于显示100个像素代表的实际距离,<v:polyline>要素用于显示比例尺。
具体显示效果如下:
scale  scale2
View more entries
 
Updated 7/3/2008
Updated 7/22/2005
Updated 12/19/2005
Updated 12/1/2005