Hi i am creating watermark on .GIF images but code is working only of .JPG images.
I am using the following code
System.Drawing.Image objImage = System.Drawing.Image.FromFile(imageURL);//From File
int height = objImage.Height;//Actual image width
int width = objImage.Width;//Actual image height
System.Drawing.Bitmap bitmapimage = new System.Drawing.Bitmap(objImage, width, height);// create bitmap with same size of Actual image
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmapimage);
SolidBrush brush = new SolidBrush(Color.FromArgb(100, 255, 255, 255));
//Adding watermark text on image
string hex = "#ADADAD";
Color _color = System.Drawing.ColorTranslator.FromHtml(hex);
g.DrawString("www.Statckoverflow.com", new Font("Trebuchet MS", 10, System.Drawing.FontStyle.Bold), new SolidBrush(_color), 5, 5);
g.DrawString("Copyright © Gitz", new Font("Trebuchet MS", 10, System.Drawing.FontStyle.Bold), new SolidBrush(_color), 5, 20);
Response.ContentType = "Image/gif";
bitmapimage.Save(Response.OutputStream, ImageFormat.Gif);
This code is woking only for .JPG files. For .GIF images its not working.Images are creating but the animation of the .GIF images are strop after creating watermark. Please correct me if I am doing something wrong on this code ?????