BitmapDrawable deprecated alternative January 19, 2023 by Tarik Do this instead: return new BitmapDrawable(context.getResources(), canvasBitmap);