The below code will create a watermark on image using C#.
using System.Drawing;
{
Bitmap bmp = new Bitmap(FileTest.PostedFile.InputStream);
Graphics canvas = Graphics.FromImage(bmp);
try
{
Bitmap bmpNew = new Bitmap(bmp.Width, bmp.Height);
canvas = Graphics.FromImage(bmpNew);
canvas.DrawImage(bmp, new Rectangle(0, 0,
bmpNew.Width, bmpNew.Height), 0, 0, bmp.Width, bmp.Height,
GraphicsUnit.Pixel);
bmp = bmpNew;
}
catch(Exception ee)
{
Response.Write(ee.Message);
}
canvas.DrawString("Text", new Font("Verdana", 14,
FontStyle.Bold), new SolidBrush(Color.Beige), (bmp.Width / 2),
(bmp.Height / 2));
bmp.Save(System.Web.HttpContext.Current.Server.MapPath("~/
WaterMarkImages/") +
FileTest.PostedFile.FileName,
System.Drawing.Imaging.ImageFormat.Jpeg);
}
You will find a great solution. :-D