diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapDrawable.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapDrawable.java
index c7cc9e7..da4c4e1 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapDrawable.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapDrawable.java
@@ -1,17 +1,19 @@
 package com.xtremelabs.robolectric.shadows;
 
+import static com.xtremelabs.robolectric.Robolectric.shadowOf;
+
+import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.ColorFilter;
 import android.graphics.Paint;
+import android.graphics.Shader.TileMode;
 import android.graphics.drawable.BitmapDrawable;
+
 import com.xtremelabs.robolectric.internal.Implementation;
 import com.xtremelabs.robolectric.internal.Implements;
 import com.xtremelabs.robolectric.internal.RealObject;
 
-import static android.graphics.Shader.TileMode;
-import static com.xtremelabs.robolectric.Robolectric.shadowOf;
-
 @SuppressWarnings({"UnusedDeclaration"})
 @Implements(BitmapDrawable.class)
 public class ShadowBitmapDrawable extends ShadowDrawable {
@@ -28,6 +30,10 @@
         this.bitmap = bitmap;
     }
 
+    public void __constructor__(Resources resources, Bitmap bitmap) {
+        this.bitmap = bitmap;
+    }
+
     /**
      * Draws the contained bitmap onto the canvas at 0,0 with a default {@code Paint}
      *
@@ -57,6 +63,7 @@
      * @return resource id from which this {@code BitmapDrawable} was loaded
      * @deprecated use com.xtremelabs.robolectric.shadows.ShadowBitmap#getLoadedFromResourceId() instead.
      */
+    @Deprecated
     @Override
     public int getLoadedFromResourceId() {
         return shadowOf(bitmap).getLoadedFromResourceId();
@@ -99,7 +106,7 @@
     public TileMode getTileModeY() {
         return tileModeY;
     }
-    
+
     @Implementation
     public void setTileModeXY(TileMode modeX, TileMode modeY) {
         setTileModeX(modeX);
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapFactory.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapFactory.java
index 642553d..5687045 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapFactory.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowBitmapFactory.java
@@ -31,6 +31,13 @@
         return bitmap;
     }
 
+    @Implementation
+    public static Bitmap decodeResource(Resources res, int id, BitmapFactory.Options opts) {
+        Bitmap bitmap = create("resource:" + getResourceName(id), opts);
+        shadowOf(bitmap).setLoadedFromResourceId(id);
+        return bitmap;
+    }
+
     private static String getResourceName(int id) {
         return shadowOf(Robolectric.application).getResourceLoader().getNameForId(id);
     }
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowResources.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowResources.java
index 82bde5a..a9323ad 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowResources.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowResources.java
@@ -123,7 +123,7 @@
     public CharSequence getText(int id) throws Resources.NotFoundException {
         return getString(id);
     }
-    
+
     public void setDensity(float density) {
         this.density = density;
     }
@@ -166,12 +166,12 @@
         if (colorDrawable != null) {
             return colorDrawable;
         }
-        
+
         if (resLoader.isNinePatchDrawable(drawableResourceId)) {
         	return new NinePatchDrawable(realResources, null);
         }
 
-        return new BitmapDrawable(BitmapFactory.decodeResource(realResources, drawableResourceId));
+        return new BitmapDrawable(realResources, BitmapFactory.decodeResource(realResources, drawableResourceId));
     }
 
     @Implementation
@@ -183,7 +183,7 @@
     public int getInteger(int id) throws Resources.NotFoundException {
     	return resourceLoader.getIntegerValue( id );
     }
-    
+
     @Implementation
     public int getDimensionPixelSize(int id) throws Resources.NotFoundException {
         // The int value returned from here is probably going to be handed to TextView.setTextSize(),
diff --git a/src/test/java/com/xtremelabs/robolectric/shadows/BitmapFactoryTest.java b/src/test/java/com/xtremelabs/robolectric/shadows/BitmapFactoryTest.java
index 85d3ac1..a24b6c4 100644
--- a/src/test/java/com/xtremelabs/robolectric/shadows/BitmapFactoryTest.java
+++ b/src/test/java/com/xtremelabs/robolectric/shadows/BitmapFactoryTest.java
@@ -26,6 +26,17 @@
     }
 
     @Test
+    public void decodeResourceWithOpts_shouldSetDescription() throws Exception {
+        BitmapFactory.Options opts = new BitmapFactory.Options();
+        Bitmap bitmap = BitmapFactory.decodeResource(Robolectric.application.getResources(), R.drawable.an_image, opts);
+        assertEquals("Bitmap for resource:drawable/an_image", shadowOf(bitmap).getDescription());
+        assertEquals(100, bitmap.getWidth());
+        assertEquals(100, bitmap.getHeight());
+        assertEquals(100, opts.outWidth);
+        assertEquals(100, opts.outHeight);
+    }
+
+    @Test
     public void decodeFile_shouldSetDescription() throws Exception {
         Bitmap bitmap = BitmapFactory.decodeFile("/some/file.jpg");
         assertEquals("Bitmap for file:/some/file.jpg", shadowOf(bitmap).getDescription());
@@ -53,6 +64,19 @@
     }
 
     @Test
+    public void decodeResourceWithOpts_shouldGetWidthAndHeightFromHints() throws Exception {
+        ShadowBitmapFactory.provideWidthAndHeightHints(R.drawable.an_image, 123, 456);
+
+        BitmapFactory.Options opts = new BitmapFactory.Options();
+        Bitmap bitmap = BitmapFactory.decodeResource(Robolectric.application.getResources(), R.drawable.an_image, opts);
+        assertEquals("Bitmap for resource:drawable/an_image", shadowOf(bitmap).getDescription());
+        assertEquals(123, bitmap.getWidth());
+        assertEquals(456, bitmap.getHeight());
+        assertEquals(123, opts.outWidth);
+        assertEquals(456, opts.outHeight);
+    }
+
+    @Test
     public void decodeFile_shouldGetWidthAndHeightFromHints() throws Exception {
         ShadowBitmapFactory.provideWidthAndHeightHints("/some/file.jpg", 123, 456);
 
