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.
Asked
Active
Viewed 1,852 times
2 Answers
0
You want to use the System.Drawing
namespace. See this:
Is there a way to programmatically add text to a System.Drawing.Image?
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