how can I clear a transparent or translucent canvas

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how can I clear a transparent or translucent canvas

Postby sebastian » Thu Mar 12, 2009 6:34 pm

Hi

I am painting some bitmaps onto a transparent canvas, so it is rendered above the system screen.

When I draw the next bitmap, I cannot clear the previously drawn one. How can I "erase" it?

If I could capture the initial canvas would be fine...because I could paint always that before drawing the bitmap...but I am not succedding on capturing it.

Thanks!
sebastian
Freshman
Freshman
 
Posts: 6
Joined: Fri Feb 20, 2009 10:47 am

Top

Postby MrSnowflake » Thu Mar 12, 2009 8:12 pm

Clear it with a paint which has it's alpha value set to 255. Won't that work?
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby sebastian » Thu Mar 12, 2009 8:21 pm

No, I've tried it, that does nothing as it has it's maximum alpha, everything with that will be transparent.

Notice that everything that I paint paints above what was painted before, the canvas is not "refreshed", I need to erase what was drawn before or clear the canvas.

The example in the APIDemos do it rights by calling a method like OpenGlClass.clear(), I need that but in 2D.

Thanks!
sebastian
Freshman
Freshman
 
Posts: 6
Joined: Fri Feb 20, 2009 10:47 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests