[英]Bitmap image file to int
我的代碼有問題..我想從https://github.com/thanhniencung/LuckyWheel設置值luckywheelitem庫,
我有來自圖庫的圖像文件,然后轉換為位圖
String root = Environment.getExternalStorageDirectory().toString() + "/Luckywheel";
Bitmap bitmap = BitmapFactory.decodeFile(root+ "/sarada.png" );
然后我想要設定值luckyItem1.icon = ;
但只是接收整數值
感謝您的關注
您應該只將一個資源文件傳遞給luckyItem1.icon
。 您應該將drawable添加到項目中,然后使用它。
例:
luckyItem1.icon = R.drawable.luckyItemIcon
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.