public string MarkWater(string path, string savePath) ...{ string addText = "www.kuqu.com"; //加在图片上的水印文字 System.Drawing.Image image = System.Drawing.Image.FromFile(path); //图片路径 System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(image); g.DrawImage(image, 0, 0, image.Width, image.Height); //在图片的特定区域写文字 System.Drawing.Font f = new System.Drawing.Font("Verdana", 24); //设置文字的字体及大小 System.Drawing.Brush b = new System.Drawing.SolidBrush(System.Drawing.Color.Blue); //设置笔刷的颜色 g.DrawString(addText, f, b, 35, 35); //加水印 g.Dispose(); //消毁对象 image.Save(savePath); image.Dispose(); //消毁对象 return savePath; }