求助??输入高度和宽度图片自动作出变化。 两个TextBox1控件,一个是宽度一个是高度。还有一个图形(也就是图片)。和一个确定按钮,当输入高度和宽度之后点击确定图片会自动随即的做出变化。这个代码如何写呀求助 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最简单的 控制 IMage 的宽度和高度 . 或者你按这个比例 重新生成缩略图 . 搜 "asp.net生成缩略图 " 1,如果页面可以刷新,那就提交 textbox的数据,后台接收后,再输入 <img src=xxx style="width:20px;height:50px">2.一般人都不会接收1这种提交刷新的效果.最常用的是用javascript动态改变图片宽高<input type=button onclick="change()" value="改变">function change(){document.getElementById("图片id").style.width=....document.getElementById("图片id").style.height=....} 缩略图<script language="JavaScript"> var flag=false; function DrawImage(ImgD){ var image=new Image(); image.src=ImgD.src; var h=parseInt(document.getElementById("textbox1").value);var w=parseInt(document.getElementById("textbox2").value);if(image.width>0 && image.height>0){ flag=true; if(image.width/image.height>= w/h){ if(image.width>w){ ImgD.width=w; ImgD.height=(image.height*w)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } } else{ if(image.height>h){ ImgD.height=h; ImgD.width=(image.width*h)/image.height; }else{ ImgD.width=image.width; ImgD.height=image.height; } } } } </script> 求进度条,页面数据加载时的进度条 asp.net中出现这样的错误怎解决? c# xml 关于实现搜索指定网站下所有页面内容问题! access数据库的一个查询和更新问题 asp.net数据导入到excel的问题 ASP.NET页面上点按钮回传服务器连接超时 .net 有关Cookie记住密码功能实现的问题。 !如何把在vs2005里调好的网站用自己的电脑做服务器发布啊? 抓取搜索页面数据,换页时,被cookie卡住了。。。 小白系列之有关page_load sql查询绑定到数据模型的问题
或者你按这个比例 重新生成缩略图 .
搜 "asp.net生成缩略图 "
再输入 <img src=xxx style="width:20px;height:50px">2.一般人都不会接收1这种提交刷新的效果.
最常用的是用javascript动态改变图片宽高<input type=button onclick="change()" value="改变">function change()
{
document.getElementById("图片id").style.width=....
document.getElementById("图片id").style.height=....
}
<script language="JavaScript">
var flag=false;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
var h=parseInt(document.getElementById("textbox1").value);
var w=parseInt(document.getElementById("textbox2").value);
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= w/h){
if(image.width>w){
ImgD.width=w;
ImgD.height=(image.height*w)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else{
if(image.height>h){
ImgD.height=h;
ImgD.width=(image.width*h)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
}
</script>