I have Image View I want to show the Current time and date on each Image View. I don't know how to edit the Image view in android.
Asked
Active
Viewed 1,929 times
2 Answers
3
Hope this trick will help:
Take a textview and add your image as it's background and set it's text to current date and time whatever you want. :)
Yes you can do that using onDraw(Canvas c) which takes canvas parameter.Here is also some functions of Canvas which can help you.

Android Killer
- 18,174
- 13
- 67
- 90
-
Thats a brilliant idea. And use padding and gravity to set the position of the text. – Jay Mayu Oct 03 '11 at 12:01
-
Thanks for your reply. But After Editing the Image I have to store that Image inside the SQL Lite Database. I am trying by using canvas Do you have any idea how to edit the Image by canvas. – mayur rahatekar Oct 03 '11 at 12:02
-
@Mayu Thanks for the complement.Yes he/she can use the properties as u mentioned to put text properly according to his/her requirement. – Android Killer Oct 03 '11 at 12:03
1
You should be able to just override the OnDraw
method and you will get the canvas parameter.
http://developer.android.com/reference/android/widget/ImageView.html#onDraw(android.graphics.Canvas)
Here is an example of someone overriding in this question: Creating Custom ImageView
In order to save this to a database you will just need to save the canvas as a bitmap

Community
- 1
- 1

James Black
- 41,583
- 10
- 86
- 166