必承其重 | 欲带皇冠 2010-06-14 07:46 采纳率: 0%
浏览 435
已采纳

如何将可绘制的位图转换为位图?

I would like to set a certain Drawable as the device's wallpaper, but all wallpaper functions accept Bitmaps only. I cannot use WallpaperManager because I'm pre 2.1.

Also, my drawables are downloaded from the web and do not reside in R.drawable.

转载于:https://stackoverflow.com/questions/3035692/how-to-convert-a-drawable-to-a-bitmap

  • 写回答

14条回答 默认 最新

  • hurriedly% 2010-06-14 09:33
    关注

    This converts a BitmapDrawable to a Bitmap.

    Drawable d = ImagesArrayList.get(0);  
    Bitmap bitmap = ((BitmapDrawable)d).getBitmap();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(13条)

报告相同问题?

悬赏问题

  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示