BitmapFactory.de codeResource()不会从绘制让我的形象我的、形象、BitmapFactory、de

2023-09-07 04:08:27 作者:雾已泪聚

我想获得图片在我的位图是这样的:

I want to get image in my bitmap like this :

bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.bug);

但给我的错误在 R.drawable.bug 错误不能被解决或不是一个字段请告诉在那里我做的事情是错误的。

but this show me error on R.drawable.bug that bug can not be resolve or is not a field please tell where I'm doing things wrong.

推荐答案

你有一个错误的绘制图形文件present 文件夹?您是否尝试过清理项目,以便 R.drawable 来正确生成?

Do you have a bug graphic file present in the drawable folder? Have you tried to clean your project in order for R.drawable to be correctly generated?