Kalai
Kalai

Reputation: 51

how to erase an image drawn by canvas?

  @Override
  protected void onDraw(Canvas canvas) {
   // TODO Auto-generated method stub
      Log.d("dd","draw");

            mBitmap=BitmapFactory.decodeResource(this.getResources(),R.drawable.image1);

            canvas.drawBitmap(mBitmap, srcRect,dstRect,null);
            mBitmaps=BitmapFactory.decodeResource(this.getResources(),R.drawable.paintball);
              canvas.drawBitmap(mBitmaps, 180,200,null);
        }

Upvotes: 0

Views: 302

Answers (1)

Reno
Reno

Reputation: 33782

Canvas.drawColor(Color.BLACK) 

or to your bg color.

Upvotes: 1

Related Questions