How to get an image size? [closed]

Add the reference System.Drawing by right clicking on your project, then add reference. Then you can add using System.Drawing; as with any other reference in the entire of .NET.

You can then use the Image class

System.Drawing.Image image = System.Drawing.Image.FromFile("filePath");
Int32 w = image.Width;
Int32 h = image.Height;

Leave a Comment