尽管还需要其他属性,但最重要的属性是图像的高度和宽度。
我试过这段代码:
private void getImageProperties()
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
Dictionary<int, KeyValuePair<string, string>> fileProps =
GetFileProps(openFileDialog.FileName);
foreach (KeyValuePair<int, KeyValuePair<string, string>> kv in fileProps)
Console.WriteLine(kv.ToString());
}
但什么是GetFileProps
?它不存在。