如何获取图像文件的尺寸? [英] How to get the the dimensions of an image file?

查看:65
本文介绍了如何获取图像文件的尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 FPN = c:\ggs\ggs Access\images\members\1.jpg

我正在尝试获取图像 1.jpg 的尺寸,我想检查图像尺寸是否有效或

I'm trying to get the dimension of image 1.jpg, and I'd like to check whether image dimension is valid or not before loading.

推荐答案

System.Drawing.Image img = System.Drawing.Image.FromFile(@"c:\ggs\ggs Access\images\members\1.jpg");
MessageBox.Show("Width: " + img.Width + ", Height: " + img.Height);

这篇关于如何获取图像文件的尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆