compound Bitmap - Android android.graphics

Android examples for android.graphics:Bitmap Operation

Description

compound Bitmap

Demo Code


//package com.java2s;
import android.graphics.Bitmap;
import android.graphics.Canvas;

public class Main {

    public static Bitmap compoundBitmap(Bitmap bg, Bitmap fg, int left,
            int top) {
        Bitmap result = Bitmap.createBitmap(bg.getWidth(), bg.getHeight(),
                Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(result);
        canvas.drawBitmap(bg, 0, 0, null);
        canvas.drawBitmap(fg, left, top, null);

        return result;
    }//w w w .j a v a  2  s .c o  m
}

Related Tutorials