Monday, June 24, 2013

ASP.NET/VB.NET - Get Attributes of Image File

In order to check attributes such as height, width, and resolution of an image file, go off the System.Drawing.Image namespace:


System.Drawing.Image.FromFile(strFile).Width
System.Drawing.Image.FromFile(strFile).Height
System.Drawing.Image.FromFile(strFile).HorizontalResolution

System.Drawing.Image.FromFile(strFile).VerticalResolution