Draw second bitmap on the first bitmap by method onDraw in Android studio
I created a customView class which exteds from View. In the method onDraw, I made a canvas and put the bitmap there, then I draw lines and circles on it. I called it in an other class in order to draw it. Now I need to draw other bitmap on the First Bitmap. When I make another canvas in onDraw and draw the new bitmap there, the application stops working.
      protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Canvas singleUseCanvas = new Canvas();//Canvas in order draw second bitmap
        canvas.drawBitmap(firstBitmap, 0, 0, new Paint());
        singleUseCanvas.drawBitmap(roomIconBitmap,100,100,iconPaint); // Second bitmap
         }
My question is: how can I draw a bitmap on an other bitmap by onDraw method? I hope that I could ask my question well. Thank you in advance!
链接地址: http://www.djcxy.com/p/67628.html