nik*_*s-e -6
我认为 DPI 不是图像的属性。DPI 是打印时使用的测量单位。
无论如何...您可以通过以下方式获取图像的宽度和高度:
var image = new Image();
image.src = "http://cdn.sstatic.net/stackexchange/img/logos/so/so-logo.png";
//show width and height in alert-popup
alert("Width: "+image.width+", Height: "+image.height);
Run Code Online (Sandbox Code Playgroud)
如果不指定宽度和/或高度,img 元素的大小始终与图像本身相同。这就是为什么这应该有效:)
| 归档时间: |
|
| 查看次数: |
8305 次 |
| 最近记录: |