您好,登錄后才能下訂單哦!
/// <summary> /// 做圖片水印(Drawing,IO) /// </summary> /// <param name="InPath">輸入圖片模板路徑</param> /// <param name="OutPath">輸入圖片路徑</param> /// <param name="oneStr">第1行文字</param> /// <param name="oneScript">1-字體</param> /// <param name="oneSize">1-字體大小</param> /// <param name="oneX">1-x坐標</param> /// <param name="oneY">1-y坐標</param> /// <param name="twoStr">第2行文字</param> /// <param name="twoScript">2-字體</param> /// <param name="twoSize">2-字體大小</param> /// <param name="twoX">2-x坐標</param> /// <param name="twoY">2-y坐標</param> private void MyGraphics(string InPath, string OutPath, string oneStr, string oneScript, int oneSize, int oneX, int oneY, string twoStr, string twoScript, int twoSize, int twoX, int twoY) { string one = oneStr; string two = twoStr; MemoryStream ms = new MemoryStream(); Bitmap bmp = new Bitmap(Server.MapPath(InPath)); Graphics g = Graphics.FromImage(bmp); g.DrawString(one, new Font(oneScript, oneSize), Brushes.White, new Point(oneX, oneY)); g.DrawString(two, new Font(twoScript, twoSize), Brushes.White, new Point(twoX, twoY)); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); System.Drawing.Image i = System.Drawing.Image.FromStream(ms); i.Save(OutPath); g.Dispose(); bmp.Dispose(); }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。