Paint.setAlpha not working

Problems with Canvas, OpenGL, etc...

Paint.setAlpha not working

Postby multiplydivide » Fri Jan 07, 2011 5:45 pm

I have a bunch of views that have overridden draw methods all drawing there corresponding layer of animation to the screen... I am trying to make it so when the user clicks down on a certain item a transparent circle is drawn behind the image of the object touched... to do this I have created two paint objects, paint1 and paint2... paint2's set alpha is set to 100 in the constructor for the view.... I then have a circle being drawn using paint2 to draw it. no matter what I set the alpha value to for paint2 it will not paint it transparent, always completely opaque...

can anyone imagine why this could be happening and how I could fix it?

I had thought of creating a somewhat transparent image and loading it as a bitmap and drawing the bitmap instead of the circle, but I think it would be more taxing on the cpu to do it this way.

Thanks for your Help
multiplydivide
Developer
Developer
 
Posts: 34
Joined: Wed Apr 28, 2010 2:09 am

Top

Re: Paint.setAlpha not working

Postby multiplydivide » Sat Jan 08, 2011 3:03 am

Figured it out...
Order of operations, set the alpha of a paint object after you set its color.
multiplydivide
Developer
Developer
 
Posts: 34
Joined: Wed Apr 28, 2010 2:09 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests