capturing image from camera and overlaying another bitmap before we save it

前端 未结 1 897
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 04:25

here tempdata is the data captured from camera, savephoto(Bitmap) is a method am using to save the image taken from camera, and it is executing accurately ,, BUt on [2]

相关标签:
1条回答
  • 2020-12-12 04:56

    you can do like this after getting after getting bitmap from camera (assume bitmap1) and your bitmap to overlay on top of bitmap1 (assume bitmap2) call this overlayMark() with your bitmaps it will return overlay bitmap that is your required bitmap . you can save that bitmap..

    private Bitmap overlayMark(Bitmap bmp1, Bitmap bmp2)    { 
       int bh = originalBitmap.getHeight();
       int bw = originalBitmap.getWidth();
       Bitmap bmOverlay = Bitmap.createBitmap(bw,bh,Bitmap.Config.ARGB_8888); 
       Canvas canvas = new Canvas(bmOverlay); 
       canvas.drawBitmap(bmp1, 0, 0, null);
       canvas.drawBitmap(bmp2, 0,0, null);
       return bmOverlay;
    } 
    
    0 讨论(0)
提交回复
热议问题