Check uploaded image's dimensions

后端 未结 7 1694
一整个雨季
一整个雨季 2020-12-09 19:46

I\'m using asp.net 3.5 and c# on my web site. Here is my question:

I have an upload button and asp:Image on a page. An user can upload an image from his computer and

相关标签:
7条回答
  • 2020-12-09 20:12

    Try this:

    Stream ipStream = fuAttachment.PostedFile.InputStream;
    using (var image = System.Drawing.Image.FromStream(ipStream))
    {                    
        float w = image.PhysicalDimension.Width;
        float h = image.PhysicalDimension.Height;
    }
    
    0 讨论(0)
提交回复
热议问题