Here you can find the source of add(Bitmap[] images)
Parameter | Description |
---|---|
Images | to be combine |
public static Bitmap add(Bitmap[] images)
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Canvas; public class Main { /**//from w w w . j a v a 2 s. c o m * combines to {@link Bitmap}s * * @param firstlayer * @param secondlayer * @return combined bitmap */ public static Bitmap add(Bitmap firstlayer, Bitmap secondlayer) { Bitmap data = Bitmap.createBitmap(secondlayer.getWidth(), secondlayer.getHeight(), secondlayer.getConfig()); Canvas temp = new Canvas(data); temp.drawBitmap(secondlayer, 0, 0, null); temp.drawBitmap(firstlayer, 0, 0, null); return data; } /** * combines to {@link Bitmap}s * * @param Images * to be combine * @return combined bitmap */ public static Bitmap add(Bitmap[] images) { Bitmap data = Bitmap.createBitmap(images[0].getWidth(), images[0].getHeight(), images[0].getConfig()); Canvas temp = new Canvas(data); for (int i = 0; i < images.length; i++) { temp.drawBitmap(images[i], 0, 0, null); } return data; } }