C#C
C#17mo ago
Tim

Getting Out of Memory Exception when loading in images

I get a system out of memory error after calling Image.FromFile in GetTarget(). How should I fix this?

        public ImageManager()
        {
            _tiles = new List<Bitmap>();
            GetTarget();
            LoadAll();
        }

        private void GetTarget()
        {
            _target = (Bitmap)Image.FromFile(@"C:\Users\timo2\OneDrive\Desktop\The Grind\Personal Projects\PhotoMosaic\PhotoMosaicGenerator\downloaded_images\image_20.jpg");
        }
Was this page helpful?