RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
asp.net做文字水印
    /// 
    /// 做图片水印(Drawing,IO)
    /// 
    /// 输入图片模板路径
    /// 输入图片路径
    /// 第1行文字
    /// 1-字体
    /// 1-字体大小
    /// 1-x坐标
    /// 1-y坐标
    /// 第2行文字
    /// 2-字体
    /// 2-字体大小
    /// 2-x坐标
    /// 2-y坐标
    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();
    }

分享文章:asp.net做文字水印
文章出自:http://scpingwu.com/article/jcesjd.html