Sample Image :
public class ChangeImage
{
public System.Drawing.Image AddCopyRightToImage(System.Drawing.Image img)
{
// Define the Bitmap, Graphics, Font, and Brush for copyright logo
Graphics g = Graphics.FromImage(img);
Font f = new Font("Arial", 9);
// Create the foreground text brush
Brush b = new SolidBrush(Color.White);
// Create the backround text brush
Brush bb = new SolidBrush(Color.White);
// Add the copyright text background
string ct = "Copyright 2009, Company Name , Inc.";
//Set Label Alighnment
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
// Add the copyright text foreground
g.DrawString(ct, f, b, img.Width / 2, 20, sf);
g.DrawImage(img, new Rectangle(0, 0, img.Width, img.Height), new Rectangle(0, 0, img.Width, img.Height), GraphicsUnit.Pixel);
return img;
}
}
thanks
ReplyDelete