zoukankan      html  css  js  c++  java
  • 图片加水印

    图片水印:

    复制代码
         string path = "UploadsImg/" + DateTime.Now.ToString("yyyyMMddHHmmssms") + FileUpload1.FileName;
            //制作画布,将选中的图片流制作成画布
            System.Drawing.Image img = System.Drawing.Image.FromStream(FileUpload1.FileContent);
            //床架绘制对象,指向到画布上
            Graphics g = Graphics.FromImage(img);
            PointF p = new PointF(10, 20);
            System.Drawing.Image logoimg = System.Drawing.Image.FromFile(Server.MapPath("UploadsImg/logo.png"));
            g.DrawImage(logoimg, p);
            img.Save(Server.MapPath(path));
            Image1.ImageUrl = path;
    复制代码

    文字水印:

    复制代码
         string path = "UploadsImg/" + DateTime.Now.ToString("yyyyMMddHHmmssms") + FileUpload1.FileName;
         string s = "WWW.ITNBA.COM";
            Font f = new Font("微软雅黑", 55);
            Brush b = new SolidBrush(Color.Red);
            PointF p = new PointF(10, 20);
            //绘制
            g.DrawString(s, f, b, p);
        
    复制代码
  • 相关阅读:
    实用产品规划
    产品经理对用户的调研
    产品经理用户研究
    竞品分析方案
    产品竞品分析
    Mybatis Plus
    shiro
    Spring cloud
    Spring Boot
    Redis入门(二)
  • 原文地址:https://www.cnblogs.com/gbbwzz/p/8478057.html
Copyright © 2011-2022 走看看