title: How to convert Android.Graphics.Bitmap to System.Drawing.Bitmap and back?
body: <p>I got this code in my Xamarin app (API 28):</p>
  <p>I tried to find a way to convert a bitmap to a graphic object (<a href="https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics?view=dotnet-plat-ext-3.1" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.drawing.graphics?view=dotnet-plat-ext-3.1</a>), with the goal to use the InterpolationMode and to apply the filter, and then to revert the change, but I failed to find a single example on how to do it.</p>
  <p>I found this: <a href="https://stackoverflow.com/questions/1535730/convert-graphics-object-to-bitmap-object">Convert graphics object to bitmap object</a>
  But it is not what I am looking for, because, I got this code:</p>
  <pre><code>private Android.Graphics.Bitmap GetBitmap(Drawable d, System.Drawing.Size? bounds)
  {
      ...some code regarding width and height, and then
      var bd = d as BitmapDrawable;
      if (bd != null)
      {
          Android.Graphics.Bitmap src = bd.Bitmap;
          if (width == src.Width &amp;&amp; height == src.Height)
          {
              return src;
          }
          else
          {
  
              Graphics myGraphics = Graphics.FromImage(src);  // here is the problem
              // USE G TO SET InterpolationMode 
              // convert resulting G somehow back to Android.Graphics.Bitmap, and return it insted of the bottom line
              return Android.Graphics.Bitmap.CreateScaledBitmap(src, width, height, true);
          }
      }
  
  }
  </code></pre>
  <p>Error code:</p>
  <pre><code>Cannot convert from Android.Graphics.Bitmap to System.Drawing.Bitmap
  </code></pre>
  <p>I need some suggestions on how to solve this, any help will be much appreciated.</p>
  <p>Thank you for your time.</p>