Android bitmap conversion

Hello,
How to convert rapidly ; An Android.Graphics.Bitmap
To a SkiaSharp.SKBitmap
Thx,
cjacquel

Posts

  • mattleibowmattleibow ZAXamarin Team Xamurai

    This is easy to do, you just need to have the SkiaSharp.Views NuGet package installed. Then, there are extension methods:

    skiaBitmap = androidBitmap.ToSKBitmap();
    androidBitmap = skiaBitmap.ToBitmap();
    

    There are also a few others, like: ToSKImage and ToSKPixmap.

    NOTE: these all make copies of the pixel data. To avoid memory issue, you can dispose of the original as soon as the method returns.

  • Chris94Chris94 Member ✭✭

    Hello,
    ToSKBitmap no longer exist in Xamarin, could you help ?
    Thx,
    Christophe

Sign In or Register to comment.