1
Answer

image list - out of memory error

Violeta Popa

Violeta Popa

11y
1.6k
1
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)