Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
How to create a time stamp on picture in c#. because when i am saving the image then it over write the already available saved picture . so i want to create a time stamp.
i am new to c#, if any one tell me the code i will be thankful.
Posted

 
Share this answer
 
Comments
asma89 22-Jun-11 9:57am    
how can i use this water mark to be a time stamp ?
fjdiewornncalwe 23-Jun-11 10:04am    
You just have to replace the text or image string being used as the watermark with a string representation of the time stamp you want.
Sergey Alexandrovich Kryukov 22-Jun-11 12:34pm    
Good sources, my 5.
--SA
Here you go.

Get the date time & put it in right location on image.

C# Snippet Tutorial - How to Draw Text on an Image[^]
Dynamically Write Text On An Image[^]
Generate Image from text using C# OR Convert Text in to Image using C#[^]
Adding Text To Image Programmatically With C#[^]

BTW I'm sorry I couldn't reply you because I was/am busy with interviews. What's the status?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Jun-11 12:34pm    
My 5.
--SA
Use somthing like this to create the file name:

String fileName = String.Format(@"{0}\image-{1}.jpg", path, DateTime.UtcNow.Ticks);
 
Share this answer
 
You can get the timestamps from the current version of the file before you save the new image by calling:

File.GetCreationTime()
File.GetLastAccessTime()
File.GetLastWriteTime()

You can save any or all of these values and then after you save your image call the appropriate File.SetXxxTime() method using the previously saved value.

I'm not sure if this is what you are looking for, but I hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900