【发布时间】:2009-12-22 22:11:06
【问题描述】:
我想为我的所有图像添加一个小的淡出水印图像。
有没有办法在 c# 中做到这一点?
【问题讨论】:
-
This open-source module 可以通过 ASP.NET 以及通过命令(从 Windows 窗体、控制台或 ASP.NET 应用程序)动态应用水印。
我想为我的所有图像添加一个小的淡出水印图像。
有没有办法在 c# 中做到这一点?
【问题讨论】:
您可以使用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+ 资源进行处理
【讨论】: