المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to deal with "OutOfMemoryExceptoin" in my C# code based on WinCE5.0 in Arm9



C# Programming
05-12-2009, 12:51 PM
How to deal with "OutOfMemoryExceptoin" in my C# code based on WinCE5.0 in Arm9
I Load many images in order to make my Project looks well and .exe file in debug and release run well in my PC.but if i copy my exe and image file to Arm based on WinCE5.0, my exe file can not run and show "OutOfMemoryExceptoin".

1.this is my way to initial images array:
private Bitmap[] bitmaps = new Bitmap[20];
public FormMain()
{
InitializeComponent();
bitmaps[0] = new Bitmap(".\\buttons\\bt1_on.bmp");
...
...
...
bitmaps[19] = new Bitmap(".\\buttons\\bt20_on.bmp");
}

2.all of my pictures files is about 993k

3.my device memory64M SDRAM
- 32bit databus
4.and when i exe file in my PC,it need 32M memory


thanks!!!!!!!!!