如何给图片打水印

来源:互联网 发布:网络舆情的预警措施有 编辑:程序博客网 时间:2024/05/16 18:43

   System.Drawing.Image img = new Bitmap("C://Documents and Settings//Administrator.0BF8BFDDAB95444//My Documents//My Pictures//s2q.jpg");
        System.Drawing.Graphics gp = Graphics.FromImage(img);

        Font myFont = new Font("黑体", 16, FontStyle.Bold);
        SolidBrush mySolidBrush = new SolidBrush(Color.Red);
        PointF myPointF = new PointF(50, 160);     
        gp.DrawString("绝代双娇", myFont, mySolidBrush, myPointF);

        img.Save(Response.OutputStream, ImageFormat.Jpeg);