【问题标题】:adding a watermark image to an image将水印图像添​​加到图像
【发布时间】:2009-12-22 22:11:06
【问题描述】:

我想为我的所有图像添加一个小的淡出水印图像。

有没有办法在 c# 中做到这一点?

【问题讨论】:

  • This open-source module 可以通过 ASP.NET 以及通过命令(从 Windows 窗体、控制台或 ASP.NET 应用程序)动态应用水印。

标签: c# image watermark


【解决方案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+ 资源进行处理

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-15
    相关资源
    最近更新 更多