日期:2014-05-17 浏览次数:20460 次
[System.Web.Services.WebMethod]
        public static void GetSound(string aa, string type)
        {
            try
            {
                string webFilePath = "";
                string webFilePath_sy = "";
                
                AddWater(webFilePath, webFilePath_sy);
            }
            catch
            {
            }
        }
/// <summary>
        /// 在图片上增加文字水印
        /// </summary>
        /// <param name="Path">原服务器图片路径</param>
        /// <param name="Path_sy">生成的带文字水印的图片路径</param>
        public void AddWater(string Path, string Path_sy)
        {
            string addText = "111111111111111111111";
            
            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", 60);
            System.Drawing.Brush b = new System.Drawing.SolidBrush(System.Drawing.Color.Green);
            g.DrawString(addText, f, b, 35, 35);
            g.Dispose();
            image.Save(Path_sy);
            image.Dispose();
        }