I need to create a very large bitmap with dimensions 13056 width, 14336 height. However when I do this code:
Bitmap
WorldMap = new Bitmap(13056, 14336);I receive this error: "ArgumentException was not handled: Parameter is not valid"
The reason I need to create such a large image is that I am 'stitching' alot of other images together.
Thankyou
Kirtan PatelPosted Aug 6, 2009, 9:58 PM
you are allocating 13056*14336*4 bytes approximately 600-700 MB
Check if you Have 600-700 MB Free Ram and having Visual Studio Also Be run at Same time
I Have 2 GB RAM i can run the code till 18000*18000 after that its cause the exception .
that's the reason you are Getting this Exception ..NET GDI+ is not the best engine for image editing.
and Try 64Bit OS for using Some More memory :)
Conclusion : - Get More RAM the more larger Bitmap You can Create :)
if answer helped you Mark "Do you like Answer" please :)
John RenstromPosted Aug 6, 2009, 8:20 PM
RyanPosted Feb 26, 2009, 5:17 PM
I am having the same problem with the same error occuring.
I am stitching together many other bitmaps into one large bitmap. I would like to handle sizes up to at least a gig if possible. The problem is when I create a bitmap with a width/height greater than around 10000 pixels it crashes. Any idea how to get around this?
Edit: I forgot to mention that I am running on a machine with 4 GB of RAM. I'm assuming this is a memory limitation of the system, but I would think that it wouldn't crash on images that would only be 500 MBs or so. Can I change something in my system to help?
Carl SchraderPosted Jan 17, 2009, 11:23 AM
James,
Are you 100 percent positive this is the line of code that is throwing the exception? I don't think that this is the line of code throwing the exception since I am able to run that line of code without receiving the exception.
I suggest taking a look at your stack trace.
Carl