因为图片有大有小,也就是表的尺寸不被图片撑爆
解决方案 »
- 小菜鸟求教超级简单问题
- 两个问题!
- 请问下面的json格式怎么封装和解析 .NET4.0
- |zyciis| 如何在windows 中的任意地方 按了键盘的[F10] 就能掉用我的WinForm程序的一个按钮事件
- 表名可不可以用变量代替
- .net中调试启动时提示“未将项目配置为进行调试”,如何解决?
- 为什么在c#的com+事务中,声明并打开一个vb的数据库连接(ADODB.Connection),需要2秒时间?
- 怎么样用c#做财务报表,如资产负债表等,有无控件可用,请高手指教
- dt.Rows[i]["民族"] = Select distinct "民族" from Orders;
- 能不能帮我解释一下
- 链表和List的选择
- 怎样使连接数据库的次数少一些呢?是不是把这句代码放进一个类里面
style="overflow:?";
overflow有几个取值
style="overflow:?";
overflow有几个取值
是个办法~!
要不就写判断语句吧
if width>……
width=……
public void showImage(string ImageRelativePath,string ServerPath){
this.ImageButton1.ImageUrl=ImageRelativePath;
System.Drawing.Image image=System.Drawing.Image.FromFile(ServerPath+"/"+ImageRelativePath);
int thiswidth=image.Width;
if(thiswidth>700)
{this.ImageButton1.Width=700;}
else
{this.ImageButton1.Width=thiswidth;}
}调用:
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
picAL=new ArrayList();
picAL.Clear();
picAL.Add("pic/200712414564.jpg");
picAL.Add("pic/7532812007143129_1.gif"); //得到服务器路径
myServerPath=Server.MapPath("");
if(IsPostBack==false)
{
CurrentPicIndex=0;
showImage(picAL[CurrentPicIndex].ToString(),myServerPath);
}
}