社区
JavaScript
帖子详情
谁有取图片尺寸的JS的代码?谢谢了
cime63
2004-10-08 02:53:45
谁有取图片尺寸的JS的代码?谢谢了
...全文
150
6
打赏
收藏
谁有取图片尺寸的JS的代码?谢谢了
谁有取图片尺寸的JS的代码?谢谢了
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
6 条
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
打赏红包
cime63
2004-10-09
打赏
举报
回复
谢谢wanghr100(灰豆宝宝.net(魔幻季节)) 了,要的就是你说的这情况情况的代码,非常感谢。非常感谢
wanghr100
2004-10-08
打赏
举报
回复
可以用这种方式,取得上传图像的高宽 :)
图像地址<input type="file" onchange="img.src=this.value">
高<input type="text" name="h">
宽<input type="text" name="w">
<div style="position:absolute;top:;left:0;visibility:hidden">
<img id="img" onload="Show(this)">
</div>
<script language="JavaScript">
function Show(oImg)
{
document.all.h.value=oImg.height;
document.all.w.value=oImg.width;
}
</script>
是是非非
2004-10-08
打赏
举报
回复
好东西
正在找自动缩放的代码呢
BlueDestiny
2004-10-08
打赏
举报
回复
<IMG SRC=imgsrc border=0 align=center onload='javascript:alert(this.width);alert(this.height)'>
------------------------------
自动改变图片大小
<script>
<!--
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 164/112){
if(image.width>164){
ImgD.width=164;
ImgD.height=(image.height*164)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>112){
ImgD.height=112;
ImgD.width=(image.width*112)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
}
}
//-->
</script>
<a href="<%=trim(rs("picurl"))%>" target="_blank">
<img src="<%=trim(rs("imgurl"))%>" border="0" width="164" height="112" onload="javascript:DrawImage(this);">
</a>
BlueDestiny
2004-10-08
打赏
举报
回复
<IMG SRC=imgsrc border=0 align=center onload='javascript:alert(this.width);alert(this.height)'>
<script>
<!--
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= 164/112){
if(image.width>164){
ImgD.width=164;
ImgD.height=(image.height*164)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>112){
ImgD.height=112;
ImgD.width=(image.width*112)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
}
}
//-->
</script>
<a href="<%=trim(rs("picurl"))%>" target="_blank">
<img src="<%=trim(rs("imgurl"))%>" border="0" width="164" height="112" onload="javascript:DrawImage(this);">
</a>
孟子E章
2004-10-08
打赏
举报
回复
<img src="" id=x>
document.all.x.width
document.all.x.height
相关推荐
易语言模块
取
图片尺寸
.rar
易语言模块
取
图片尺寸
.rar 易语言模块
取
图片尺寸
.rar 易语言模块
取
图片尺寸
.rar 易语言模块
取
图片尺寸
.rar 易语言模块
取
图片尺寸
.rar 易语言模块
取
图片尺寸
.rar
易语言
取
GIF
图片尺寸
易语言
取
GIF
图片尺寸
源码,
取
GIF
图片尺寸
,
取
tif尺寸,
取
gif尺寸,转十进制
JavaScript写的腾讯软件中心
JS
焦点图
代码
,调用方便,
图片尺寸
610x205
JavaScript写的腾讯软件中心
JS
焦点图
代码
,调用方便,
图片尺寸
610x205
易语言从字节集
取
图片尺寸
易语言从字节集
取
图片尺寸
源码,从字节集
取
图片尺寸
,GetImageSize,CombineBytes
取
GIF
图片尺寸
.rar
取
GIF
图片尺寸
.rar
发帖
JavaScript
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
8.7w+
社区成员
22.4w+
社区内容
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
帖子事件
创建了帖子
2004-10-08 02:53
社区公告
暂无公告