最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】C#获得图片大小

C# crifan 2384浏览 0评论

【问题】

C#中,需要获得图片大小

【解决过程】

参考:

how to get the image dimensions from the file name

写出对应代码:

using System.Drawing;
//C:/Users/CLi/AppData/Local/Temp/WindowsLiveWriter2049324412/supfiles62D643/from location to birdname both show_thumb.png
Image img = Image.FromFile(srcFullname);
int srcFileWidth = img.Width;
int srcFileHeight = img.Height;

转载请注明:在路上 » 【已解决】C#获得图片大小

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.179 seconds, using 22.08MB memory