try this. You may need to amend the size options depending on the size of your image. I use this for 128x128 images.
public static Bitmap getOverlayedImage(Resources res, Drawable img1, Drawable img2) {
float den = res.getDisplayMetrics().density;
int dip = (int) (80 * den + 0.5f);
int sz = (int) (128 * den + 0.5f);
Drawable[] layers = new Drawable[2];
layers[0] = img1;
layers[1] = img2;
LayerDrawable layerDrawable = new LayerDrawable(layers);
layerDrawable.setLayerInset(1, dip, dip, 0, 00);
Bitmap b = Bitmap.createBitmap(sz, sz, Bitmap.Config.ARGB_8888);
layerDrawable.setBounds(0, 0, sz, sz);
layerDrawable.draw(new Canvas(b));
return b;
}
call it like this:
getOverlayedImage(getResources(), drawable1, drawable2);