How to read the width and height of a physical image file?

Asked

Viewed 509 times

4

How to get the width and height of a physical image file?

  • What format is the file? What image technology is using?

  • @bigown jpeg and png. If it can be something more generic that addresses several formats it would help me even more. However jpeg and png are already enough.

2 answers

5


4

Can for some supported formats:

var imagem = Image.FromFile("teste.jpg");
var largura = imagem.Width;
var altura = imagem.Height;

In accordance with the documentation it is possible to open BMP, GIF, JPEG, PNG and TIFF.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.