Hello sir,
Thank you for your reply first! I tried the method you suggested, and it did work!!!
Really appreciate!
```
val frameBitmap = constraintFrame.drawToBitmap()
val viewFinderBitmap = viewFinder.bitmap!!
val overlayBitmap = combine2bitmap(viewFinderBitmap, frameBitmap)
saveMediaLocally(overlayBitmap)
```
```
private fun combine2bitmap(viewFinderBit: Bitmap, frameBit: Bitmap): Bitmap{
var bitmapOverlay: Bitmap = Bitmap.createBitmap(frameBit.width, frameBit.height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmapOverlay)
canvas.drawBitmap(viewFinderBit, Matrix(), null)//Draw the viewFinder
canvas.drawBitmap(frameBit, 0f, 0f, null)//Draw the frame
viewFinderBit.recycle()
frameBit.recycle()
return bitmapOverlay
}
```
I used the
canvas.drawBitmap(bitmap1: Bitmap, Matrix(), null)
canvas.drawBitmap(bitmap2: Bitmap, 0, 0, null)
May I ask why the second line of canvas.drawBitmap(bitmap2: Bitmap, 0, 0, null) didn't overlay the whole original picture, but only overlay for the center of the preview?
Really appreciate for your helpful suggestion,
Sincerely, Leo