Theoretically, it should be 65 535 x 65 535, if you have enough memory, about 17 GB.
However, by creating the .NET 4.5 Console application to test it, it throws a System.ArgumentException: the parameter is invalid.
The application is built for a 64-bit platform. It works on a 64-bit platform with 32 GB of memory. The maximum resolution I was able to get is 22,000 x 22,000 pixels.
I could not find documentation on this.
And the strange behavior is that even with 22,000 x 22,000 pixels, this does not always work. Sometimes it fires, and it sometimes throws an exception. This makes me think that this is due to the continuous distribution of memory, but there is about 30 GB of free memory.
Does anyone have any experience with this? And if I wanted to work, say, 100,000 x 100,000 pixels or more, what would be a better way than implementing my own bitmap?
EDIT: The problem is not the .NET Maximum Object Size. This can be overcome by targeting on 64-bit platforms and setting the gcAllowVeryLargeObjects flag in the application configuration. That way, I can make the application consume more than 15 GB of memory with a single array of integers. So far, the answer seems to lie in the base implementation of GDI +, but how do I get around it?
source share