Hi,
I tried to place text watermark on the top of the A0 & 2A0 size tiff images.I m not able to fix the watermark on the top of the image.Once watermark is added image size increased from 600kb to 4MB .I want to add watermark with same size and it should be placed on the top of the image.can anyone help?
protected void Upload(object sender, EventArgs e)
{
string text = DateTime.Now.ToString("yyyyMMddHHmmss");
using (System.Drawing.Image img = System.Drawing.Image.FromFile(@"C:\Users\Vintoh\Desktop\images\10000-593A1.tiff"))
{
//Select the active page
img.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, 0);
using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(img.Width, img.Height))
{
using (System.Drawing.Graphics grp = System.Drawing.Graphics.FromImage(bmp))
{
grp.DrawImage(img, new System.Drawing.Point(0, 0));
string watermarkText = "Viewed by Vinoth" + text;
Brush brush = new SolidBrush(Color.Red);
Font font = new Font("Arial", 50, FontStyle.Bold, GraphicsUnit.Pixel);
SizeF textSize = new SizeF();
textSize = grp.MeasureString(watermarkText, font);
grp.TranslateTransform(bmp.Width / 12, bmp.Height / 12);
grp.RotateTransform(360);
grp.DrawString(watermarkText, font, brush, -(textSize.Width / 6), -(textSize.Height / 6));
}
bmp.Save(@"C:\Users\Vintoh\Desktop\imagess\modified.tiff");
}
}
}