0

I was wondering if there is an image library in .NET which would allow me to open a JPEG image on the fly and add a text field (for ex: Software version) Basically I should be able to send the software version to this library. And this image based library should modify/add a text to the image and save it.

this-Me
  • 2,139
  • 6
  • 43
  • 70

2 Answers2

0

You want to use the System.Drawing namespace. See this:

Is there a way to programmatically add text to a System.Drawing.Image?

Community
  • 1
  • 1
viggity
  • 15,039
  • 7
  • 88
  • 96
0
Image origImage;
using (Stream s = new FileStream(path, FileMode.Open, FileAccess.Read);
{
    origImage = Image.FromStream(s);
}

using (Image newImage = new Bitmap(origImage))
{
    Graphics graphics = Graphics.FromImage(newImage);
    graphics.DrawString("Software version: " + version, font, Brushes.Black, 0, 0);

    newImage.Save(newPath, ImageFormat.Jpeg);
}

origImage.Dispose();
György Kőszeg
  • 17,093
  • 6
  • 37
  • 65