如何使用javascript查找图像的宽度和高度 [英] How to find image width and height using javascript

查看:64
本文介绍了如何使用javascript查找图像的宽度和高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net开发程序,我在其中使用javascript编码特别是部分。


我需要找到加载图像文件的高度和宽度。 />

我怎么能为它编写代码。

Hi, I am developing program using asp.net in which i am using javascript coding in particular part.

I need to find height and width for loaded image file.

How can i write coding for it.

推荐答案

你可以通过它的样式检查它属性或 offsetHeight offsetWidth


亲切的问候。

dmjpro。
u can check it by it''s style property or by offsetHeight and offsetWidth.

kind regards.
dmjpro.


使用height和width属性。请参阅链接


如果卡住,请发布一些代码。
Using the height and width properties. See link.

If you get stuck, post some code.


我需要找到上传图像的高度和宽度。


例如:如果上传的图像文件是C:\Documents and Settings \My Documents\My Pictures\globe_img.gif,然后我需要通过分配到本地图像变量来找到图像globe_img.gif的图像高度和宽度。


任何想法。
I need to find height and width for uploaded images.

Ex: if uploaded image file is C:\Documents and Settings\My Documents\My Pictures\globe_img.gif, then i need to find the image height and width for the image globe_img.gif by assigning to local image variables.

Any idea.


这篇关于如何使用javascript查找图像的宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆