此處我的代碼是從dll的.resx文件中加載資源。它加載的資源很好,直到它遇到大約40左右,然後它開始拋出內存異常。有誰能向我解釋爲什麼會發生這種情況嗎?還有如何解決它?System.Drawing.dll中的內存不足異常
編輯:
我改變所有項目在我的解決方案是64位解決我的問題。
感謝
/// <summary>
/// Loads all default resources.
/// </summary>
/// <returns></returns>
private static List<Bitmap> LoadAllInternalResources()
{
List<Bitmap> Ret = new List<Bitmap>();
#region Spades
Ret.Add(MainResources.MainResources._50);
Ret.Add(MainResources.MainResources._46);
Ret.Add(MainResources.MainResources._12);
Ret.Add(MainResources.MainResources._38);
Ret.Add(MainResources.MainResources._34);
Ret.Add(MainResources.MainResources._30);
Ret.Add(MainResources.MainResources._26);
Ret.Add(MainResources.MainResources._22);
Ret.Add(MainResources.MainResources._18);
Ret.Add(MainResources.MainResources._14);
Ret.Add(MainResources.MainResources._10);
Ret.Add(MainResources.MainResources._6);
Ret.Add(MainResources.MainResources._2);
#endregion Spades
#region Clubs
Ret.Add(MainResources.MainResources._49);
Ret.Add(MainResources.MainResources._45);
Ret.Add(MainResources.MainResources._41);
Ret.Add(MainResources.MainResources._37);
Ret.Add(MainResources.MainResources._33);
Ret.Add(MainResources.MainResources._29);
Ret.Add(MainResources.MainResources._25);
Ret.Add(MainResources.MainResources._21);
Ret.Add(MainResources.MainResources._17);
Ret.Add(MainResources.MainResources._13);
Ret.Add(MainResources.MainResources._9);
Ret.Add(MainResources.MainResources._5);
Ret.Add(MainResources.MainResources._1);
#endregion Clubs
#region Hearts
Ret.Add(MainResources.MainResources._51);
Ret.Add(MainResources.MainResources._47);
Ret.Add(MainResources.MainResources._43);
Ret.Add(MainResources.MainResources._39);
Ret.Add(MainResources.MainResources._35);
Ret.Add(MainResources.MainResources._31);
Ret.Add(MainResources.MainResources._27);
Ret.Add(MainResources.MainResources._23);
Ret.Add(MainResources.MainResources._19);
Ret.Add(MainResources.MainResources._15);
Ret.Add(MainResources.MainResources._11);
Ret.Add(MainResources.MainResources._7);
Ret.Add(MainResources.MainResources._3);
#endregion Hearts
#region Diamonds
Ret.Add(MainResources.MainResources._52);
Ret.Add(MainResources.MainResources._48);
Ret.Add(MainResources.MainResources._44);
Ret.Add(MainResources.MainResources._40);
Ret.Add(MainResources.MainResources._36);
Ret.Add(MainResources.MainResources._32);
Ret.Add(MainResources.MainResources._28);
Ret.Add(MainResources.MainResources._24);
Ret.Add(MainResources.MainResources._20);
Ret.Add(MainResources.MainResources._16);
Ret.Add(MainResources.MainResources._12);
Ret.Add(MainResources.MainResources._8);
Ret.Add(MainResources.MainResources._4);
#endregion Diamonds
#region Jokers
Ret.Add(MainResources.MainResources._54);
Ret.Add(MainResources.MainResources._53);
#endregion Jokers
return Ret;
}
圖像有多大?曾經有一組非常好的72x96卡可以輕鬆地加載到ImageList或磁盤v中。該網站已經不存在了,但我確定有人將其緩存/鏡像到某處 – Plutonix
圖像非常大,大約每個365K。我猜測我可以達到32x程序允許的最大內存容量。將檢查。 – SneakyTactician