How do I write text over a picture in Android and save it?

You can put an EditText and write into it, and after writing, you first convert it to Bitmap like:

Bitmap bmp = Bitmap.createBitmap(mEditText.getDrawingCache());

Now you can add created image bmp to your original image like this:

Call: Bitmap combined = combineImages(bgBitmap,bmp);

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

Leave a Comment