1
0 Comments

Convert Drawable to Bitmap Android code

Showing images from internet get time to load on the screens, some times we need to show images from the drawable folder on dynamically. We can show images from drawable folder by setImageResource() and setImageBitmap() methods. In this post we will cover how to convert drawable to bitmap in android. we will show you convert drawable to bitmap and append this bitmap image to Imageview

To Convert Drawable to Bitmap we will use BitmapFactory.decodeResource() property. This property takes two arguments.

Resource Instance
Resource ID
val bitmap = BitmapFactory.decodeResource(resources, R.drawable.control_staements)

Convert Drawable to Bitmap

on July 15, 2021
Trending on Indie Hackers
From building client websites to launching my own SaaS — and why I stopped trusting GA4! User Avatar 40 comments I built a tool that turns CSV exports into shareable dashboards User Avatar 38 comments The “Open → Do → Close” rule changed how I build tools User Avatar 32 comments I lost €50K to non-paying clients... so I built an AI contract tool. Now at 300 users, 0 MRR. User Avatar 25 comments $0 to $10K MRR in 12 Months: 3 Things That Actually Moved the Needle for My Design Agency User Avatar 23 comments Everyone is Using AI for Vibe Coding, but What You Really Need is Vibe UX User Avatar 23 comments