1
How do I get image resolution? I have a web application and I need to get this data from an image on the localhost.
1
How do I get image resolution? I have a web application and I need to get this data from an image on the localhost.
3
If it’s height and width, it’s pretty simple:
string path = @"C:\caminho\qualquer\minha_imagem.jpg";
var img = Image.FromFile(path);
// img.Width é a largura
// img.Height é a altura
Now, if you want the pixels per inch (semantically closer to an image resolution), it would be something like:
string path = @"C:\caminho\qualquer\minha_imagem.jpg";
var img = Image.FromFile(path);
var graf = Graphics.FromImage(img);
var resolucao = (bmp.Width / bmp.HorizontalResolution) * graf.DpiX;
Browser other questions tagged c#
You are not signed in. Login or sign up in order to post.
What image? Give more data, put what you are doing.
– Maniero
I have an image on the server where the application is. I need to get this data (resolution) from it.
– Leandro Belo
This you’ve already written, but if you don’t give relevant information about what you’re doing, what you’re using, giving an example of code, what resources you’re using, it’s impossible to answer.
– Maniero