title: How to convert stream to bitmap in xamarin.forms to adjust image contrast
body: <p>I am trying to raise the contrast of an image in Xamarin.forms using <a href="https://efundies.com/adjust-the-contrast-of-an-image-in-c/" rel="nofollow noreferrer">this</a> algorithm. My code gives me in image in the form of a System.IO.Stream, which I want to convert to a Bitmap/LockBitmap to use the algorithm.</p>
  
  <p>I tried code such as <code>using System.Drawing</code>, which didn't work. The error said "the type or namespace bitmap could not be found." Then, I tried <code>using Android.Graphics</code>, which fixes that error, but I don't know if it will work with a Xamarin.forms app that needs to run on Android and iOS.</p>
  
  <p>Even if that does work, how do I actually convert a System.IO.Stream into a Bitmap? Is there another algorithm that doesn't require bitmaps?</p>
  
  <p>Edit: I think I can use BitmapFactory to convert the stream into a bitmap.</p>