title: How to Resize height and width of a image dynamically in SSRS Report?
body: <p>I want to resize image height and width dynamically in SSRS report based on expression but there is no expression option available in image size properties its only take numeric values.
  I want resize my image like below c# code.</p>
  <pre class="lang-cs prettyprint-override"><code>private void GetImageSize(string path)
  {
      try
      {
          System.Drawing.Image image = System.Drawing.Image.FromFile(path);
          if (image != null)
          {
              System.Drawing.Image imageResized = ((System.Drawing.Image)image.Clone());
              int resizeWidth = 0;
              int resizeHeight = 0;
              bool heightIsLongerDimension = (imageResized.Height &gt; imageResized.Width);
              float heightInches = (float)(imageResized.Height / imageResized.VerticalResolution);
              float widthInches = (float)(imageResized.Width / imageResized.HorizontalResolution);
  
              if (heightIsLongerDimension)
              {
                  resizeHeight = (int)(imageResized.VerticalResolution * 3);
                  //resizeWidth = Convert.ToInt32((((heightInches - 3) / heightInches) * widthInches) * imageResized.HorizontalResolution);
                  resizeWidth = Convert.ToInt32((((float)imageResized.Width) / (float)imageResized.Height) * imageResized.HorizontalResolution) * 3;
              }
              else
              {
                  resizeWidth = (int)(imageResized.HorizontalResolution * 3);
                  //resizeHeight = Convert.ToInt32((((widthInches - 3) / widthInches) * heightInches) * imageResized.VerticalResolution);
                  resizeHeight = Convert.ToInt32((((float)imageResized.Height) / (float)imageResized.Width) * imageResized.VerticalResolution) * 3;
              }
              //image height and width set in pixel
              Image1.Height = resizeHeight;
              Image1.Width = resizeWidth;
              //image height and width set in inches
              float width = (float)(Math.Round((resizeWidth / imageResized.HorizontalResolution), 1));
              float height = (float)(Math.Round((resizeHeight / imageResized.VerticalResolution), 1));
          }
      }
      catch
      {
          throw;
      }
  }
  </code></pre>