List of utility methods to do Bitmap Combine
Bitmap | combineDrawables(Resources resources, int head, int body, int legs) combine Drawables Bitmap headBitmap = getBitmap(resources, head); Bitmap bodyBitmap = getBitmap(resources, body); Bitmap legsBitmap = getBitmap(resources, legs); int height = headBitmap.getHeight() + bodyBitmap.getHeight() + legsBitmap.getHeight(); int width = Math.max(headBitmap.getWidth(), Math.max(bodyBitmap.getWidth(), legsBitmap.getWidth())); Bitmap result = Bitmap.createBitmap(width, height, ... |
Bitmap | combineImages(Bitmap c, Bitmap s) Combine bitmap images. Bitmap cs = null; cs = Bitmap.createBitmap(c, 0, 0, c.getWidth(), c.getHeight()); Canvas comboImage = new Canvas(cs); comboImage.drawBitmap(s, 0f, 0f, null); return cs; |
Bitmap | merge(Bitmap bmp1, Bitmap bmp2) merge if (null == bmp1 || bmp1.isRecycled() || null == bmp2 || bmp2.isRecycled()) return null; Paint paint_comm = new Paint(Paint.ANTI_ALIAS_FLAG); Bitmap bmOverlay = Bitmap.createBitmap(bmp2.getWidth(), bmp2.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bmOverlay); float x = (bmp2.getWidth() - bmp1.getWidth()) / 2f; ... |