6

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....

Khaled Annajar
  • 15,542
  • 5
  • 34
  • 45
sam786
  • 498
  • 1
  • 4
  • 10

3 Answers3

2

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));

Barış Çırıka
  • 1,570
  • 1
  • 15
  • 24
2

Try to this

 bitmap.eraseColor(getResources().getColor(R.color.thumb));
0

you need to check every pixel of image and change its color.

You will get your answer in this link Refer This

Community
  • 1
  • 1
Arvind Kanjariya
  • 2,089
  • 1
  • 18
  • 23
  • thanks aravind....but i didnt get solution for this...i want a toast for background rect and another toast for bitmap image in ontouchevent by using if contion....can u help me – sam786 Nov 05 '12 at 05:31