如何在c#中找到图像的尺寸?

问题描述 投票:0回答:1

我正在尝试找出图像中有多少像素(分别为宽度和高度)。我使用了此代码,但这不起作用。

System.Drawing.Image img = System.Drawing.Image.FromFile(@"C:\Users\leoga\Documents\Projects_VSCode\C#\Simple.jpg");MessageBox.Show("Width: " + img.Width + ", Height: " + img.Height);

c# image visual-studio
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.