All you have to do is take two bitmaps and set their borders. Then you need to draw them as on canvas. If you want to set the image as translucent, you need to set the alpha of the image.
This is an example:
Bitmap bitmap = null; try { bitmap = Bitmap.createBitmap(500, 500, Config.ARGB_8888); Canvas c = new Canvas(bitmap); Resources res = getResources(); Bitmap bitmap1 = BitmapFactory.decodeResource(res, R.drawable.test1); //blue Bitmap bitmap2 = BitmapFactory.decodeResource(res, R.drawable.test2); //green Drawable drawable1 = new BitmapDrawable(bitmap1); Drawable drawable2 = new BitmapDrawable(bitmap2); drawable1.setBounds(100, 100, 400, 400); drawable2.setBounds(150, 150, 350, 350); drawable1.draw(c); drawable2.draw(c); } catch (Exception e) { } return bitmap; }
source share