我明白了,这是什么消息的装置(需要做的处置非托管资源),但真的不明白为什么它在我的情况发生:一般性错误+再次
System.Drawing.Image imgAnimaha, imgNoanimaha;
using (System.IO.Stream file = thisExe.GetManifestResourceStream("WindowsApplication1.img.noanimaha135.gif"))
{
using (System.Drawing.Image img = Image.FromStream(file))
{
imgNoanimaha = (System.Drawing.Image)img.Clone();
}
}
using (System.IO.Stream file = thisExe.GetManifestResourceStream("WindowsApplication1.img.animaha135.gif"))
{
using (System.Drawing.Image img = Image.FromStream(file))
{
imgAnimaha = (System.Drawing.Image)img.Clone();
}
}
pbDiscovery.Image = imgAnimaha;
在这种情况下,我得到“GDI +发生了一个通用错误”为什么以及如何解决? PS。如果我写以下内容:
pbDiscovery.Image = imgNoanimaha;
它能正常工作。 我真的不明白的地方和非托管资源没有设置...
您是否尝试过使用不同的位图? – 2013-03-21 16:22:44