0

如何将imageview数组传递给以下代码

图像视图数组

private Integer[] Imgid = {
            R.drawable.pic1,
            R.drawable.pic2,
            R.drawable.pic3,
            R.drawable.pic4,
    };

    Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),**R.drawable.pic1[]???**);
4

2 回答 2

0

像普通数组一样调用。

 Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),imgid[index]);
于 2013-07-11T07:24:57.093 回答
0

你必须创建一个Bitmap数组,并且你已经运行了一个循环来放入drawable这样的位图中:

private Integer[] Imgid = {
            R.drawable.pic1,
            R.drawable.pic2,
            R.drawable.pic3,
            R.drawable.pic4,
    };
    Bitmap bitmapOrg[];
    for (int i = 0; i < Imgid.length; i++) {        
        bitmapOrg[i] = BitmapFactory.decodeResource(getResources(),Imgid[i]);
    }
于 2013-07-11T07:28:59.833 回答