0

Hi I have a surfaceview in my layout, which i draw a bitmap. I make the surfaceview transparent by calling this code :

     SurfaceHolder holder = getHolder();
            holder.setBackgroundColor(Color.TRANSPARENT);
            holder.setFormat(PixelFormat.TRANSPARENT); 
// mBitmap is bitmap
mBitmap = mBitmap

Now i want to clear the screen by using this :

mBitmap.eraseColor(Color.TRANSPARENT);

But it does not work.

I have tried the following also

canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
            this.mBitmap.eraseColor(Color.TRANSPARENT);

The above things are not working.But it does not work. If i replace Color.TRANSPARENT with any other color it does paint the whole surface with that color i.e.

 mBitmap.eraseColor(Color.BlUE);

Please help me if anyone knows the answer.Thanks in advance...

4

0 回答 0