Violeta Popa

Violeta Popa

  • NA
  • 137
  • 163.8k

image list - out of memory error

Jul 4 2013 6:21 AM
Hi :) i have an image list..and sometimes i get the error: out of memory. This is the code for my list:

List<Image> images = new List<Image>();
            Image image1 = Image.FromFile(@"C:\Users\Vio\Desktop\Gestiune asigurari auto\Gestiune asigurari auto\Imagini\2.jpg");
            Image image2 = Image.FromFile(@"C:\Users\Vio\Desktop\Gestiune asigurari auto\Gestiune asigurari auto\Imagini\3.jpg");
            Image image3 = Image.FromFile(@"C:\Users\Vio\Desktop\Gestiune asigurari auto\Gestiune asigurari auto\Imagini\4.jpg");
            Image image4 = Image.FromFile(@"C:\Users\Vio\Desktop\Gestiune asigurari auto\Gestiune asigurari auto\Imagini\5.jpg");
            images.Add(image1);
            images.Add(image2);
            images.Add(image3);
            images.Add(image4); etc What should i do?thanks!

Answers (1)