我正在尝试创建位图
BitmapDrawable img = new BitmapDrawable(getResources(), "res/drawable/wrench.png");
Bitmap wrench = img.getBitmap();
//Bitmap wrench = BitmapFactory.decodeResource(getResources(), R.drawable.wrench);
canvas.drawColor(Color .BLACK);
Log.d("OLOLOLO",Integer.toString(wrench.getHeight()));
canvas.drawBitmap(wrench, left, top, null);
但是当我调用wrench.getHeight()时,程序因 NullPoinerException 而失败。(我将文件放在可绘制目录中)我该如何解决我的问题?