当我尝试创建图像时
Image<Gray, Byte> testImage = new Image<Gray, Byte>("david.jpg");
编译时出现An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll
异常。但是如果我使用
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK || result == DialogResult.Yes)
{
textBox1.Text = openFileDialog1.FileName;
}
Image<Gray, Byte> testImage = new Image<Gray, Byte>( textBox1.Text);
它有效。问题是它找不到路径?我在项目文件夹中添加所有 .jpg 文件。