【发布时间】:2017-04-27 13:21:56
【问题描述】:
我尝试从我在resource.java 上声明的drawable 设置位图图像。当我单击下一步按钮时,它将显示另一个我可以绘制的图像。这是调用它的正确代码吗?
bmp = BitmapFactory.decodeResource(getResources(), Resource.capitalStoke[DrawingActivity.this.position]);
还是要添加?
这是我的资源.java:
public class Resource {
public static String DRAWING_ALPHABET;
public static Integer[] capitalStoke;
Integer[] alphabetCapital;
Integer[] alphabetSound;
Integer[] alphabetImage;
static {
DRAWING_ALPHABET = "alphabet";
capitalStoke = new Integer[]{Integer.valueOf(R.drawable.capital_letters_stroke_01),
Integer.valueOf(R.drawable.capital_letters_stroke_02),
Integer.valueOf(R.drawable.capital_letters_stroke_03),};
}
是否可以使用 bitmapfactory 从这里检索图像?如果可以,我应该怎么做?
【问题讨论】:
标签: android