如何將Drawable轉換爲位圖? - How to convert a Drawable to a Bitmap?

問題:

I would like to set a certain Drawable as the device's wallpaper, but all wallpaper functions accept Bitmap s only. 我想將某個Drawable設置爲設備的牆紙,可是全部牆紙功能僅接受Bitmap I cannot use WallpaperManager because I'm pre 2.1. 個人2.1版以前沒法使用WallpaperManager web

Also, my drawables are downloaded from the web and do not reside in R.drawable . 另外,個人可繪製對象是從Web下載的,並不位於R.drawable ide


解決方案:

參考一: https://stackoom.com/question/Cjim/如何將Drawable轉換爲位圖
參考二: https://oldbug.net/q/Cjim/How-to-convert-a-Drawable-to-a-Bitmap
相關文章
相關標籤/搜索