可以从资源传递给R.的图像加载一个String。可以从传递String参数的资源加载R.drawable?
我想这一点:
public static Bitmap LoadBitmap(Context context, String filename)
{
Bitmap image;
image = BitmapFactory.decodeResource(context.getResources(), R.drawable.filename);
return image;
}
抛出以下错误:
filename cannot be resolved or is not a field
我试图创建R档creatic恒定的场,而抛出下面一行:
R.java was modified manually! Reverting to generated version!
我会感谢您的帮助或建议。谢谢
你能不能举个例子吗?我可以用inputstream来做吗?谢谢 – karse23 2011-03-06 17:30:15