1.采用客户端javascript可以取得图片大小 
<input > 

<script type="text/javascript">
        function abc() {
            alert(img2.width);
        }
    </script>

2.采用流取得图片大小  
Stream stream=file.PostedFile.InputStream; 
System.Drawing.Image image=System.Drawing.Image.FromStream(stream);

int picWidth= image.Width;
int picheight= image.Height;
3.使用文件得到图片大小 
System.Drawing.Image image=System.Drawing.Image.FromFile(图片路径)

 int picWidth= image.Width;
int picheight = image.Height;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2021-11-20
  • 2021-12-23
  • 2021-07-02
  • 2021-11-20
  • 2021-07-03
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案