I get this exception:
Error System.ArgumentException
Message = "The parameter is not valid."
Source = "System.Drawing"
StackTrace:
in System.Drawing.Bitmap..ctor (Int32 width, Int32 height, PixelFormat format)
in System.Drawing.Bitmap..ctor (Int32 width, Int32 height) ...
when I create a new bitmap this way:
Bitmap resImage = new Bitmap(width, height);
resImage.SetResolution(600, 600);
where the width and height are the dimensions converted to a pixel for 600 dpi of the size specified by the user in cm, which is in this particular case 28x41 cm (image in A3 format), corresponding to 6614x9685 pixels. After that, I will create a graphic object from a bitmap and draw it using the GDI + methods. I need a high resolution image, because it will be added to the pdf document, and I want to get an excellent result.
I get this exception only if the method is called from a web application that references a DLL in which all the print logic is written. A.
Why am I getting this exception? How can i solve the problem?
Thanks in advance for your help!
source
share