Тут ещё знаете, в чем может быть дело...
Не в размере даже, а во внутренностях конкретного файла с картинкой.
Ошибка может озвучиваться системой, как "out of memory", хотя на самом деле просто не получается у неё открыть файл из-за некорректного формата пикселей.
Вот что пишет интернет на эту тему:
| Цитата |
|---|
This problem may occur when you use the Bitmap.FromFile method and one of the following conditions is true:
The image file is corrupted. The image file is incomplete. Note You may experience this problem if your application is trying to use the Bitmap.FromFile method on a file stream that is not finished writing to a file. * The image file does not have a valid image format or GDI+ does not support the pixel format of the file. * The program does not have permissions to access the image file. * The BackgroundImage property is set directly from the Bitmap.FromFile method. |
Это бывает со всякими jpg, например. Файл не открывается (например, при просмотре, такая же штука случается) и пишет out of memory, хотя на самом деле просто не может этот файл открыть.
Помогает обычно, если открыть такой файл в графическом редакторе и пересохранить его.