I have a method for screenshot which takes the View from XML and convert to Bitmap object, and I have multiple PNG on layout View. Some PNG have transparent Area which appears as Black color in Bitmap (which i want to change to White) or want to get rid of Black transparent area.
private void takescreenshot(LinearLayout preview) throws IOException
{
View z = preview; // get whole layout view
z.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(z.getDrawingCache());
z.destroyDrawingCache();
}
2
Answers
finally i figure out the solution as well
create a new blank bitmap
create canvas object
fill the canvas a background
put old bitmap in your canvas.