Transparent View with Android

Posted by victorusmo on Stack Overflow See other posts from Stack Overflow or by victorusmo
Published on 2010-05-10T02:22:33Z Indexed on 2010/05/10 2:28 UTC
Read the original article Hit count: 756

Filed under:
|
|
|
|

Hi everybody,

I try to have a bitmap moving over my android application. I m be able to have my bitmap behind my text view, but not over them.

  public void onCreate(Bundle savedInstanceState)
...
     // ll is a FrameLayout
     ll.addView(text1);
     ll.addView(text2);
     ll.addView(new Panel(this),200,400);

my Panel class is defined like this :

    class Panel extends SurfaceView
......
 @Override
        public void onDraw(Canvas canvas) {
           canvas.drawColor(0, PorterDuff.Mode.CLEAR);
            Bitmap bitmap;
            GraphicObject.Coordinates coords;
            for (GraphicObject graphic : _graphics) {
                bitmap = graphic.getGraphic();
                coords = graphic.getCoordinates();
                canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);
            }
        }

Can you help me ?

How Can i Draw a transparent bitmap over my views of my application

Thanks a lot,

Cheers,

Victor

© Stack Overflow or respective owner

Related posts about android

Related posts about layout