Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 向图像中添加水印图像_C#_Image_Watermark - Fatal编程技术网

C# 向图像中添加水印图像

C# 向图像中添加水印图像,c#,image,watermark,C#,Image,Watermark,我想在我的所有图像中添加一个小的、淡出的水印图像 有没有办法在c#中实现这一点?您可以使用系统来合成图像。绘图 //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)) {

我想在我的所有图像中添加一个小的、淡出的水印图像


有没有办法在c#中实现这一点?

您可以使用
系统来合成图像。绘图

//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);
只需确保处置所有用作系统的资源。绘图使用非托管GDI+资源

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