title: System.ArgumentException: "Parameter is not valid." instantiating a new Bitmap
body: <p>I get this exception: </p>
  
  <blockquote>
    <p>System.ArgumentException occurred<br>
    Message="Parameter is not valid."<br>
    Source="System.Drawing"<br>
    StackTrace:<br>
         at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)<br>
         at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)...</p>
  </blockquote>
  
  <p>when I instantiate a new Bitmap in this way:</p>
  
  <pre><code>Bitmap resImage = new Bitmap(width, height);
  resImage.SetResolution(600, 600);
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Why I obtain this exception? How can I solve the problem? </p>
  
  <p>Thanks in advance for every help!</p>