例如最大显示为800*600??
解决方案 »
- .net FastReport 如何创建一个带查询条件的报表
- 遇到DZ!NT搬家的问题,把原来二级域名论坛搬到顶级域名的子目录下
- jquery动态增加上传控件问题
- 高手请进关于gridview问题!
- 希望得到帮助,.net如何在程序中设定新建页面?
- 不能调试的问题!
- FolderBrowser是否可以在WEB窗体上使用(等待高手。。。。)
- 我在DataGrid中设了一个checkbox模板列,但无论选中不选中,总是认为checked=false
- asp.net中如何在(datagrid)textbox中加入事件调用另一个函数?(Web)
- 我用TreeView为什么总出错?
- datagrid的超链接列难道只能带一个参数么?
- 那里有iis的最新版本下载?
scriptString += "if(document.all." + Image1.ClientID + ".height>100) document.all." + Image1.ClientID + ".height = 100";
scriptString += "</script>";
if(!this.IsStartupScriptRegistered("Startup"))
this.RegisterStartupScript("Startup", scriptString);
var newNode = document.createElement("img");
newNode.src = url;
if(newNode.width>700)
newNode.width=700;
if(newNode.height>525)
newNode.height=525;
不行,第一次打开的时候总是会按照图片原大小显示,再次打开就会没事了
img不要指定它的width,和height,因为你也不知道。
这样可以么
这个具体应该怎么做啊?
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>= 90/90){
if(image.width>90){
ImgD.width=90;
ImgD.height=(image.height*90)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
else{
if(image.height>90)
{
ImgD.height=90;
ImgD.width=(image.width*90)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
} </script><body>
<img src="shop/smallimg.gif" onload="javascript:DrawImage(this);" border="0">
</body>
System.Drawing.Image logo = System.Drawing.Image.FromFile(Server.MapPath(ImageButton1.ImageUrl));
Response.Write(logo.Width);
Response.Write(logo.Height);
logo.Dispose();
图片的形状有时候不会是很规则,有时候需要限制 长度,该怎么办?
image.src=ImgD.src;
之后
if(image.width>0 && image.height>0)能够得到图片的大小吗?好像不行吧