title: Resize image width in c# but not the height
body: <p>How do you resize the width of a image in C# without resizing the height using image.resize()</p>
  
  <p>When I do it this way:</p>
  
  <pre><code>image.Resize(width: 800, preserveAspectRatio: true,preventEnlarge:true);
  </code></pre>
  
  <p>This is the full code:</p>
  
  <pre><code>var imagePath = "";
  var newFileName = "";
  var imageThumbPath = "";
  WebImage image = null;            
  image = WebImage.GetImageFromRequest();
  if (image != null)
  {
      newFileName = Path.GetFileName(image.FileName);
      imagePath = @"pages/"+newFileName;
      image.Resize(width:800, preserveAspectRatio:true, preventEnlarge:true);
      image.Save(@"~/images/" + imagePath);
      imageThumbPath = @"pages/thumbnail/"+newFileName;
      image.Resize(width: 150, height:150, preserveAspectRatio:true, preventEnlarge:true);
      image.Save(@"~/images/" + imageThumbPath);
  }
  </code></pre>
  
  <p>I get this error message:</p>
  
  <blockquote>
    <p>No overload for method 'Resize' takes 3 arguments</p>
  </blockquote>