0

I have try this

public Bitmap combineImages(Bitmap ScaledBitmap, Bitmap bit) {

    int X = bit.getWidth();
    int Y = bit.getHeight();

    Scaled_X = ScaledBitmap.getWidth();
    scaled_Y = ScaledBitmap.getHeight();

    System.out.println("Combined Images");

    System.out.println("Bit :" + X + "/t" + Y);

    System.out.println("SCaled_Bitmap :" + Scaled_X + "\t" + scaled_Y);

    overlaybitmap = Bitmap.createBitmap(ScaledBitmap.getWidth(),
            ScaledBitmap.getHeight(), ScaledBitmap.getConfig());
    Canvas canvas = new Canvas(overlaybitmap);
    canvas.drawBitmap(ScaledBitmap, new Matrix(), null);
    canvas.drawBitmap(bit, new Matrix(), null);

    return overlaybitmap;
}

its not working

ArcticLord
  • 3,999
  • 3
  • 27
  • 47
parmar prit
  • 3
  • 1
  • 2

1 Answers1

4

try this code sniplet and tweak as per your requirements

 private Bitmap overlay(Bitmap bmp1, Bitmap bmp2) {
        Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig());
        Canvas canvas = new Canvas(bmOverlay);
        canvas.drawBitmap(bmp1, new Matrix(), null);
        canvas.drawBitmap(bmp2, new Matrix(), null);
        return bmOverlay;
    }

make sure bmp1 is the bigger than bmp2

Sourabh Saldi
  • 3,567
  • 6
  • 34
  • 57