In my android application I use camera to capture photo. I want to print date and time on captured photo. As in normal camera there is an option that, if you set date and time on camera then it will printed on right lower side of the photo.
To capture the photo I use cameraIntent:
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
and in onActivityResult I save in photo.
Now how I print date and time on this photo.
open the bitmap as a canvas and write the date/time as text wherever you like. The changes would would saved on the bitmap.
Some sample code is as follows. Google Paint and Canvas classes for more options
Finally, we can draw text with this font via the following Canvas method:
The first parameter is the text to draw. The next two parameters are the coordinates
where the text should be drawn to ( play with them to get the position right). Then is Paint instance. No need to use drawBimtap. Whatever you will do on the canvas will be saved on the original bitmap directly without over-writing.