title: Save a picture in Tiff format without compression
body: <p>I just found out TIFF has several formats. For some reason when using</p>
  
  <pre><code>Using bm As New Bitmap(rect.Width, rect.Width)
  bm.Save("C:\testfolder\screenshot.png", Imaging.ImageFormat.Tiff)
  </code></pre>
  
  <p>the format becomes LZW compressed, which I can't use in a third-party library.</p>
  
  <p>After some searching I found that .NET does provide a library to save as TIFF with different compression options, I wanted to try them all but I don't know how to implement it. Or I should say I didn't figure out how to use it:</p>
  
  <blockquote>
    <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.tiffcompressoption?view=netframework-4.8#examples" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.tiffcompressoption?view=netframework-4.8#examples</a></p>
  </blockquote>
  
  <p>The purpose is I want to get a region screenshot and save it as TIFF.</p>
  
  <pre><code>Dim stream As New FileStream("new.tif", FileMode.Create)
  Dim encoder As New TiffBitmapEncoder()
  encoder.Compression = TiffCompressOption.Zip
  encoder.Frames.Add(BitmapFrame.Create(image))   &lt;--what is this "image"?
  encoder.Save(stream)
  </code></pre>
  
  <p>What is that <code>image</code> entity? A stream? How to get a region of captured screenshot to be saved as a TIFF?</p>
  
  <p>If </p>
  
  <pre><code>Using bm As New Bitmap(rect.Width, rect.Width) 
  </code></pre>
  
  <p>I don't mind to save it first then only reread the bmp stream. The only problem is I have no idea what is that "image" given in the example stands for.</p>
  
  <p>I read some info from here but I still haven't figured it out:
  <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmapframe.create?view=netframework-4.8" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.imaging.bitmapframe.create?view=netframework-4.8</a></p>
  
  <p>Kindly offer me an example how to use the code if you figured it out.</p>