I tried to write the text in this way but it does not work and I do not understand where I'm wrong.
mImageView.buildDrawingCache();
Bitmap bmap = mImageView.getDrawingCache();
Canvas c = new Canvas (bmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setStyle(Style.FILL);
paint.setTextSize(20);
c.drawText("Some Text", 0, 25, paint);
I tried several times but the display can not display any text. I have to make sure that this image is then saved with the written text. thanks
You can try,i'm used 1 trick simple. I created an external FrameLayout containing an ImageView and a TextView inside Like the code below :
The results will be as follows :
Here is the simple example how to draw text on ImageView:
MainActivity.java
activity_main.xml