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....
Bitmaps (i.e. files with . BMP extension) do not natively support transparency: you need to save as a different format like PNG. Another format that supports transparency is GIF but it is only suitable for simple images with few colours.
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));
Try to this
bitmap.eraseColor(getResources().getColor(R.color.thumb));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With