James
"mike" <mi...@discussions.microsoft.com> wrote in message
news:0006C8F4-4E2D-4FD8...@microsoft.com...
> Hi,
>
> I am trying to create a bitmap using the (int,int) constructor.
>
> I am getting an invalid parameter exception when I pass in the following
> values
>
> Bitmap bm = new Bitmap(4050,40750);
>
> Is there a maximum size limit I am hitting when I try this?
>
> Thanks
>
> Jay
However, we do provide our users the ability to save graphical output as an
image instead of sending it to a plotter, and in this case the image was 13.5
inches wide, and 136 inches long, and the user had selected 300 dpi.
These plot sizes are not uncommon for our application.
Mainly what I was hoping for was the limit constraints so I could include
those in my dialog box when validating the image settings, as opposed to just
popping up a message saying "Image too Big", without being able to give an
answer to the user as to what the largest size image is.
Anyway.. thanks for the input
Each image in the system has the amount of memory defined by this formula..
bit-depth*width*height/8
This means that an image 40800 pixels by 4050 will require over 660
megabytes of memory. To manipulate this image. Especially to print it you
need a minimum of twice this much live memory and probably more because the
printdrivers may also be doing some banding as well. This doesn't take into
account the amount of memory required by the system or any other images that
might be in it.
Theoretically .NET can manipulate these large images. In practice however,
the strain placed on the paging system for virtual memory is so great that
the system will grind to a halt and will seem to have frozen. The only way
to enable the use of large images is to have lots and lots of free memory.
Four gigabytes would be a useful minimum. More would be better.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"SharpCoderMP" <csha...@interia.pl.NFSPM> wrote in message
news:Ov$fIhFcF...@TK2MSFTNGP09.phx.gbl...
I guess my main goal is to determine what check is being done in the .Net
code on the parameters and throwing the exception. It would be much more
meaningful to the users if I could actually document the size limit
constraints and also perform some validation in the UI before trying to
create an image.
I realize the size of that file would be huge, but I really just want to
understand the hard limits of the Bitmap constructor (if there are any).
The problem I run into is it isn't uncommon for some of our outputs to be
42" x 72" (and greater). When drawing to a plotter this all works fine, but
we also give the user the ability to save as an image so they can include the
output in a report (either powerPoint, Word, etc.). Clearly it makes no sense
to save the image as 42" X 72" at 300dpi if it is just going to be included
on a PP slide, but that doesn't mean a user won't try to do it.
Anyway.. again, thanks for your input, and also your website.