I have a bunch of photos at home that I'd like to add a time and date stamp to based on the file properties.
I'll be writing this as a WPF application but does anyone have sample c# code on how to add text to a .jpg file in the bottom right hand corner of the photo?
I know there are a couple of libraries out there but would like to actually have the c# code itself as I can see a few applications of that here at Muppet Labs plus it'd be nice to learn this also.
EDIT
Thanks to Andy for the link. I have posted my code here for others to see the solution.
System.Drawing.Image img = System.Drawing.Image.FromFile("Brush Tail Possum.jpg");
System.Drawing.Image imgOverlay = System.Drawing.Image.FromFile("overlay.png");
Graphics gr = Graphics.FromImage(img);
Font font = new Font("Times New Roman", (float)12, System.Drawing.FontStyle.Regular);
System.Drawing.Color color = System.Drawing.Color.FromArgb(255, 255, 255, 255);
StringFormat stringFormat = new StringFormat();
stringFormat.Alignment = StringAlignment.Center;
stringFormat.LineAlignment = StringAlignment.Center;
gr.SmoothingMode = SmoothingMode.AntiAlias;
gr.DrawImage(imgOverlay, new System.Drawing.Point(img.Width - 78, img.Height - 25));
gr.DrawString(DateTime.Now.ToShortDateString(), font, new System.Drawing.SolidBrush(color), new System.Drawing.Point(img.Width - 40, img.Height - 15), stringFormat);
MemoryStream outputStream = new MemoryStream();
img.Save("Brush Tail Possum2.jpg");
Overlay.png is a small image that sits under the text and aids in readability.