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