C# 后台图片写字体

使用C#绘制用户个人标识并保存
本文介绍如何在C#中通过读取图片、绘制文字和保存新图片实现个性化用户标识的功能。
  private void DraweImage()
        {
            //Image image = Image.FromFile(Server.MapPath("Resources/images/logo.jpg"));//读取图片
            //Graphics g = Graphics.FromImage(image);//创建画笔
            //g.DrawImage(image, 0, 0, image.Width, image.Height);//画图
            //SolidBrush drawBrush = new SolidBrush(Color.FromA#01154f);//创建刷子
            //Font drawFont = new Font("微软雅黑", 13, FontStyle.Regular);//设置地体
            //int xPos = 179; int yPos = 12;//设置位置
            ////g.DrawString(this.LoadUserName, drawFont, drawBrush, xPos, yPos);//写字
            //image.Save(Server.MapPath("Resources/images/logocs/" + this.LoadUser.Login + ".jpg"));//保存
            ////g.Dispose();//释放资源
            //image.Dispose();//释放资源
            //tabMain.Attributes.Add("style", "background:#d2e6fe url(Resources/Images/logocs/" + this.LoadUser.Login + ".jpg) no-repeat;height: 100%; overflow: hidden;");
        }

转载于:https://www.cnblogs.com/Look_Sun/archive/2012/02/14/2350882.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值