asp上传图片问题,上传后如何固定图片的长度与宽度?高分加尝

来源:百度知道 编辑:UC知道 时间:2024/06/07 00:35:28
asp上传图片问题,上传后如何固定图片的长度与宽度?
我在第页里就是一个<%=rs(content)%>这样就可以输出该图片了.但不知道以下就如何固定长度与宽度了.
请大家帮帮忙呀..急用..不然给老板骂了.
还是不行: 有谁可以帮帮我啊? 加我QQ: 199248375 注明图片问题.

试试在数据库里面添架while="100" height="100"这样设置吧.

<script language=JavaScript>
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>= 140/180){
if(image.width>140){
ImgD.width=140;
ImgD.height=(image.height*140)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
/*ImgD.alt=image.width+"×"+image.height;*/
}
else{
if(image.height>180){
ImgD.height=180;
ImgD.width=(image.width*180)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
/*ImgD.alt=image.width+"×"+image.height;*/
}
}
/*else{
ImgD.src="";
ImgD.alt=""
}*/
}
</script>

把以上这段代码加在<head>&l