How to compose (combine) two photo images in android?

Hi I need to make a DRM image file using two image files. I originally used the bufferedImage class, but android does not support bufferedImage.

please help me. how to make two images in android?

+4
source share
1 answer

You can do this by superimposing two images. Suppose bmp1 is larger (for protection) and bmp2 is a marker:

private Bitmap overlayMark(Bitmap bmp1, Bitmap bmp2) { Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig()); Canvas canvas = new Canvas(bmOverlay); canvas.drawBitmap(bmp1, 0, 0, null); canvas.drawBitmap(bmp2, distanceLeft, distanceTop, null); return bmOverlay; } 

distanceLeft and distanceTop determine the position of the marker.

+3
source

Source: https://habr.com/ru/post/1334449/


All Articles