因为图片有大有小,也就是表的尺寸不被图片撑爆

解决方案 »

  1.   

    把表固定大小,然后图片就设width=100% height=100%
      

  2.   

    利用样式(css):
    style="overflow:?";
    overflow有几个取值
      

  3.   

    <table><tr><td><img src="图片路径名" width=宽度 hight=高度></td></tr></table>
      

  4.   

    利用样式(css):
    style="overflow:?";
    overflow有几个取值
    是个办法~!
    要不就写判断语句吧
    if width>……
    width=……
      

  5.   

    //用ImageButton来显示图片,参数:ImageRelativePath(图片的相对路径),ServerPath(Web服务器的路径)
    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);
    }
    }