悬赏分:100 浏览:405 次
Image.FromFile(sFilePath, true);
FileStream fs = new FileStream(sFilePath, FileMode.Open, FileAccess.Read);
Image img = Image.FromStream(fs, true, true);|
I've met a similiar problem, I can load a jpg file, but can't save it to file, or there is a "OutOfMemoryException".
What I suggest you to do is to check if the ".ico" file is valid, open it with other software. Maybe you can try to use Icon.ctor(string) to load this file to an Icon instance. Than use Bitmap.ctor(Icon) to convert the object to an Image object. 楼上的好厉害, 都是E文 啊~~~ 直接用ICon 类试试呢? |