Windows Develop Bookmark and Share   
 index > Windows Forms General > Bitmap "Parameter is not valid" error when for high width/height values
 

Bitmap "Parameter is not valid" error when for high width/height values

I'm getting the "parameter is not valid" error when doing something simple like this:

Bitmap

temp = new Bitmap(16000, 16000);

I thought the limitation is 32767? It seems I can go up to around 14000 before this error starts cropping up


www.infusion.com - Infusion Development
Derek Chan Old  Tuesday, September 29, 2009 2:57 PM
Use a 64 bit OS. You need contiguous memory. Typically about 500 MB on a 32 bit OS.
JohnWein  Tuesday, September 29, 2009 3:55 PM
Hi Derek,

Thank you for the feedback. I can reproduce it on my computer.

When I tested the code on my computer, at first, it didn’t popup that error message. But my physical memory usage reached a very high rate. When the code was run the second time, the error message “Parameter is not valid�popup. If I run the code under VS debug mode, my computer almost dead.

So I think it is not the limitation of the .NET but the limitation of computer memory. I have installed 2 GB memory on my computer which allows me to run the code once. Could you please tell me why you want to create such large bitmap? Do you have any other way to implement it?

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Wednesday, September 30, 2009 3:55 AM

You can use google to search for other answers

Custom Search

More Threads

• Trial application
• Blinking a cell in datagridview
• Language of MessageBox
• Is there a way to do default text with a WinForms textbox?
• Can someone please help me convert the following C# Calss to VB
• how to save files in a directory?
• Smooth Edge Form VB.NET
• Using Window Messages
• text field date formatting.
• Anyone got any nice Controls to add to toolbox in your designer???? I found one....