将水印图像添​​加到图像

时间:2009-12-22 22:11:06

标签: c# image watermark

我想在我的所有图像中添加一个小的,渐弱的水印图像。

有没有办法在c#中执行此操作?

1 个答案:

答案 0 :(得分:1)

您可以使用System.Drawing

撰写图像
//1. create a bitmap (create a empty one or from file)
Bitmap bmpPic = new Bitmap(imgWidth,imgHeight);

//2. pass that bitmap into Graphics
using (Graphics g = Graphics.FromImage(bmpPic))
{
    //manipulate the image
}

//3. save the bitmap back to a filestream
bmpPic.Save(imgFileStream,ImageFormat.Png);

确保处理用作System.Drawing的所有资源使用非托管GDI +资源

相关问题