image1.Width 是宽度而value是获得Unit的长度

解决方案 »

  1.   

    可是image1.Width 好像不是integer类型的。
    直接用image1.Width 进行比较会出错
      

  2.   

    Dim img As New Image()
            img.ImageUrl = "../images/img1.jpeg"
            Dim a As String
            a = img.Width.ToString
            Label1.Text = a得到的结果是a=""
    可是我的img1.jpeg明明存在呀!
      

  3.   

    image1.Width 是Unit型的你可以用 Drawing.Image对象来获得图片的宽度System.Drawing.Image bmp = System.Drawing.Image.FromFile(Page.MapPath("") + 文件名);int height = bmp.Height;
    int width = bmp.Width;这个是绝对可以的