I try to pick an image from gallery and add some text on it then save it. Can you tell me where should i look or what library shoul i use? I am using Android Studio 2.2
Asked
Active
Viewed 111 times
1 Answers
1
Firstly, you can put an EditText and write into it, and after writing, you first convert it to Bitmap like below
Bitmap bitmap = Bitmap.createBitmap(mEditText.getDrawingCache());
Now you can add created image bitmap to your original image like this
Bitmap combined = combineImages(bgBitmap,bitmap);
public Bitmap combineImages(Bitmap background, Bitmap foreground) {
int width = 0, height = 0;
Bitmap cs;
width = getWindowManager().getDefaultDisplay().getWidth();
height = getWindowManager().getDefaultDisplay().getHeight();
cs = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas comboImage = new Canvas(cs);
background = Bitmap.createScaledBitmap(background, width, height, true);
comboImage.drawBitmap(background, 0, 0, null);
comboImage.drawBitmap(foreground, matrix, null);
return cs;
}
I hope it helps.

emrekose26
- 683
- 1
- 8
- 21
-
can you refer any links?? – Muhammad Waleed Dec 08 '16 at 18:59