views:

81

answers:

1

My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.

I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).

Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.

Canvas mCanvas = holder.lockCanvas(null);
Bitmap mybit = BitmapFactory.decodeResource(mFrameLayout.getResources(), R.drawable.icon);
mCanvas.drawColor(0, Mode.CLEAR);
mCanvas.drawBitmap(mybit, 0, 0, null);
holder.unlockCanvasAndPost(mCanvas);

Thanks in advance.

A: 

There is an example of a Spinning cube in the samples. You should be have to have a look at that and see how they got a transparent background.

CaseyB