BitmapFactory.decodeResource() renvoie la valeur null pour la forme définie en xml drawable

J'ai regardé à travers de multiples questions similaires, bien que je n'ai pas trouvé la bonne réponse à ma requête.

J'ai un drawable, défini dans shape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >

    <solid android:color="@color/bg_color" />
</shape>

Je veux le convertir en objet Bitmap afin d'effectuer certaines opérations, mais BitmapFactory.decodeResource() renvoie la valeur null.

C'est comment je le fais:

Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.shape);

Ce que je fais mal? Est BitmapFactory.decodeResource() applicable pour xml défini un drawable?

InformationsquelleAutor mol | 2014-06-24