title: Adding a Time/Date stamp to photos
body: <p>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.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thanks to Andy for the link.  I have posted my code here for others to see the solution.</p>
  
  <pre><code>    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");
  </code></pre>
  
  <p>Overlay.png is a small image that sits under the text and aids in readability.</p>