我的一个项目文件夹中有一张图片:让我们说它在:
~/App_Themes/Default/images/SomeImage.png
我想将此图像加载到 System.Drawing.Image 中,我该怎么做?
如果我尝试使用 Image 类的 FromFile 方法:
Image img = Image.FromFile("~/App_Themes/Default/images/SomeImage.png", true);
我得到一个FileNotFoundException
.
我读过一些建议将图像存储到服务器中,但这不是一个选项。有没有办法将它加载到图像中?