Do this instead:
return new BitmapDrawable(context.getResources(), canvasBitmap);
Related Contents:
- Can the Android drawable directory contain subdirectories?
- How to create Drawable from resource
- setBackground vs setBackgroundDrawable (Android)
- Android splash screen image sizes to fit all devices
- Android – drawable with rounded corners at the top only
- How do you obtain a Drawable object from a resource id in android package?
- How do I set the rounded corner radius of a color drawable using xml?
- Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable’s Hue
- Replace selector images programmatically
- Android: failed to convert @drawable/picture into a drawable
- Is it possible to rotate a drawable in the xml description?
- Why isn’t my vector drawable scaling as expected?
- Android: Cloning a drawable in order to make a StateListDrawable with filters
- How to programmatically set drawableRight on Android Edittext?
- Contact Bubble EditText
- What’s the correct size icon for drawable-xxhdpi?
- Get the URI of an image stored in drawable
- how to access the drawable resources by name in android
- Shape drawable as background, a line at the bottom
- Using drawable resources
- setBackgroundResource() discards my XML layout attributes
- what does android getIntrinsicHeight and getIntrinsicWidth mean?
- android animation is not finished in onAnimationEnd
- Modifying the color of an android drawable
- Android : Rotate Vector Image to 90 degree
- Android TextView drawable, change padding between drawable and text?
- error: cannot find symbol variable abc_ic_ab_back_mtrl_am_alpha
- Drawable to byte[]
- Drawing multiple shapes with ShapeDrawable in xml with Android
- How to use default Android drawables
- Finding the dominant color of an image in an Android @drawable
- Android: Change Shape Color in runtime
- How to get round shape in Android [duplicate]
- Is there a way to set drawable’s Alpha using XML?
- Center CheckBox drawable within itself
- Tiled drawable sometimes stretches
- Default selector background in Clickable Views
- android drawable from file path
- Shape Drawable Size not working
- Newer versions of Android Studio add only two drawable directories – drawable and drawable-v21
- how to get images dynamically from drawable folder
- Android Button Drawable Tint
- Android, Drawable.createFromStream(is, srcname): what’s the 2nd parameter meaning?
- Only use XHDPI drawables in Android app?
- Drawable folders in res folder?
- Is it possible to load a drawable from the assets folder?
- Android : LocationManager vs Google Play Services
- Creating a button in Android Toolbar
- Android 11 Scoped storage permissions
- Android – In App Purchase – you need to add the BILLING permission to your APK