How to change background color of bitmap to transparent and background should not drag?

13,723

Solution 1

Try to add

Bitmap bitmap= Bitmap.createBitmap(255, 255, Bitmap.Config.ARGB_8888);

after that try this line (A is alpha value interval is 0-255 and 0 is fully transparent).

bitmap.eraseColor(Color.argb(AAA,RRR,GGG,BBB));

Solution 2

Try to this

 bitmap.eraseColor(getResources().getColor(R.color.thumb));
Share:
13,723
sam786
Author by

sam786

Updated on June 13, 2022

Comments

  • sam786
    sam786 almost 2 years

    I used:

    Bitmap bitmap= Bitmap.createBitmap(255, 255, Bitmap.Config.RGB_565); 
    Canvas canvas = new Canvas(bitmap); 
    

    Background color is black....

    If I use:

    Bitmap.Config.ARGB_8888; 
    

    background color is white...

    my question is that How to change background color of bitmap to transparent and background should not drag? only center image have to drag...

    plz can anybody say this solution or example....