how can I clear a transparent or translucent canvas

by sebastian » Fri, 13 Mar 2009 01:43:06 GMT

Sponsored Links

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.



how can I clear a transparent or translucent canvas

by Eric » Fri, 13 Mar 2009 02:44:03 GMT

 > Just call Canvas.drawColor(0).

That probably won't do much because it uses the default srcover
porterduff mode

Canvas.drawColor( 0, PorterDuff.Mode.CLEAR );

would be better


Sponsored Links

how can I clear a transparent or translucent canvas

by sebastian » Fri, 13 Mar 2009 16:38:42 GMT

 I worked perfectly fine!

Thanks :)


Other Threads

1. Using Droid-fu

Hello everyone,
                       I'm trying to use the droid-fu libraries in my
project but I guess I have no idea what I am doing. I plan on using
BetterAsyncTask to send a couple of images to a server and then have
the program return a response. The problem I am having is after I add
the droid-fu .jar file into my build path. I then try to extend my
main activity as follows

import com.github.droidfu.activities.BetterDefaultActivity;

        public class MainActivity extends BetterDefaultActivity {
        /** Called when the activity is first created. */
        protected void onCreate(Bundle savedInstanceState) {


Before I even add any code to my project the program crashes if I try
to run it. I get the following exception:

03-02 20:43:47.784: ERROR/AndroidRuntime(3238):
java.lang.RuntimeException: Unable to start activity

Any help would really be appreciated! I am about ready to give up on
the droid-fu libraries and just use the regular AsyncTask . Do I need
to add anything to my manifest file??


2. booting from Nand flash

hi all ,

I am working on DM368 Board .i have extracted the android filesystem
from the froyo repo .i am trying to boot android froyo from Nand
flash .

i am using initramfs filesystem for android rootfs. i have created
separate partitions on nand flash for system ,data and cache .i am
using yaffs2 filesystem for system,data and cache partitions.

when android kernel boots it mounts the rootfs filesystem and the init
process mounts the system,data and cache partitions.

i have got this problem ,here is the logcat msg .

I/dalvikvm( 2285): Unable to dlopen(/system/lib/
Cannot load library: load_library[1083]: Library '/system/lib/' not found
W/dalvikvm( 2285): Exception Ljava/lang/UnsatisfiedLinkError; thrown
during Landroid/media/DecoderCapabilities;.<clinit>
W/dalvikvm( 2285): Exception Ljava/lang/ExceptionInInitializerError;
thrown during Landroid/media/MediaFile;.<clinit>
E/Zygote  ( 2285): Error preloading
E/Zygote  ( 2285): java.lang.ExceptionInInitializerError
E/Zygote  ( 2285):      at java.lang.Class.classForName(Native Method)
E/Zygote  ( 2285):      at java.lang.Class.forName(
E/Zygote  ( 2285):      at java.lang.Class.forName(
E/Zygote  ( 2285):      at
E/Zygote  ( 2285):      at
E/Zygote  ( 2285):      at dalvik.system.NativeStart.main(Native
E/Zygote  ( 2285): Caused by: java.lang.ExceptionInInitializerError
E/Zygote  ( 2285):      at
E/Zygote  ( 2285):      at<clinit>(
E/Zygote  ( 2285):      ... 6 more
E/Zygote  ( 2285): Caused by: java.lang.UnsatisfiedLinkError: Library
media_jni not found
E/Zygote  ( 2285):      at java.lang.Runtime.loadLibrary(
E/Zygote  ( 2285):      at java.lang.System.loadLibrary(
E/Zygote  ( 2285):      at<clinit>(
E/Zygote  ( 2285):      ... 8 more
D/AndroidRuntime( 2285): Shutting down VM
W/dalvikvm( 2285): threadid=1: thread exiting with uncaught exception
D/skia    ( 2285): purging 6K from font cache [1 entries]
I/ServiceManager( 1736): service 'media.audio_flinger' died
I/ServiceManager( 1736): service 'media.player' died
I/ServiceManager( 1736): service '' died
I/ServiceManager( 1736): service 'media.audio_policy' died

when the android console comes up ,i can see the
library in system/lib directory,but it says it cant find the library
which is something i didnt understand.

i am able to boot the DM368 board using the same android filesystem
extracted above with nfs filesystem ,but when i boot from  nand
flash ,i see this problem. the same problem was coming for
library too.

i think this is due to lack of permissions ,can anyone help me whats
going wrong .what are the correct permissions i have to give so that
the libraries can be loaded by the dalvikvm.



3. problem booting from nand flash

4. Can't share via gallery to gmail

5. (Full) NFC support for Android (on a Nexus S, specifically)

6. NFC p2p with NFC Reader

7. How to communicate with SmartCard such as e-ID, e-Passport using ISO14443 APDU format???