I get this exception:
System.ArgumentException occurred
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)...
when I instantiate a new Bitmap in this way:
Bitmap resImage = new Bitmap(width, height);
resImage.SetResolution(600, 600);
where width and height are the dimensions converted in pixel for 600 dpi of the size set by the user in cm, which is in this specific case 28x41 cm (A3 format image) corresponding to 6614x9685 pixel. After that I will create a graphics object from the bitmap and draw on it with the methods of GDI+. I need an high resolution image because it is going to be added to a pdf document and I want a great quality result.
I get this exception only if a call the method from a web application, that references the dll in which all the printing logic is written.
Why I obtain this exception? How can I solve the problem?
Thanks in advance for every help!