【问题标题】:How to convert byte[] or bitmap to integer (R.drawable.picture) Android java如何将字节 [] 或位图转换为整数 (R.drawable.picture) Android java
【发布时间】:2015-12-05 10:21:00
【问题描述】:

我要转换

byte[] image = cursor.getBlob(5);

Bitmap bit_image = getImage(image);

byte[]Bitmap 转换为R.drawable.picture

我需要它是 integerint 而不是 int[]),因为我的自定义列表视图只接受 int

list_view_class.add(new List_view_class(R.drawable.picture,text);

【问题讨论】:

    标签: java android bitmap


    【解决方案1】:

    你不能做你想做的事。 R.drawableR.string不是资源本身,而是对应用程序中资源的引用。所以你不能将任何类型的对象转换为R 或其他东西。您可以做的是使用Bitmap 并直接显示它。

    【讨论】:

      猜你喜欢
      • 2012-08-02
      • 2018-05-06
      • 2023-04-06
      • 2018-08-21
      • 2011-06-26
      • 2012-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多