C#图片添加水印
工作中写的一个图片加水印的小方法,记录在这里
/// <summary> /// 创建水印图片 /// </summary> /// <param name="newFileName"></param> public void createImage(string newFileName) { this.FileUpload1.SaveAs(Server.MapPath("../uploadFile/temp/") + newFileName); string FilePath1 = Server.MapPath("../uploadFile/temp/") + newFileName; string FilePath2 = Server.MapPath("../uploadFile/member/01.png"); System.Drawing.Image image1 = System.Drawing.Image.FromFile(FilePath1); System.Drawing.Image image2 = System.Drawing.Image.FromFile(FilePath2); Graphics g = Graphics.FromImage(image1); g.DrawImage(image2, image1.Width / 8, image1.Height / 8,
(image1.Width-image1.Width/4), (image1.Height-image1.Height/4)); image1.Save(Server.MapPath("../uploadFile/member/" + newFileName),
System.Drawing.Imaging.ImageFormat.Jpeg); g.Dispose(); image1.Dispose(); }
- 评论
-
- [使用Ctrl+Enter键可以直接提交]
表情图标
Advertise
Category
Time Counter
离十一还有
Recent Article
- 1.亦舒经典作品语录
- 2.工作笔记:AS3加载外部图片,有加载百分比
- 3.document.documentElement和document.body的区别
- 4.100种增加网站流量的方法
- 5.用div+css模拟表格对角线
- 6.如何做一个好的技术型领导
- 7.苍井空是谁?
- 8."心态"新解
- 9.程序员特有的9个坏习惯
- 10.AS3入门之简单Loading效果
- 11.系统问题:浏览器无法打开png图片
- 12.AS3中以post和get方式提交数据
- 13.defaultTextFormat和setTextFormat()区别
- 14.AS3中超方便地遍历xml
- 15.pv3d中物体常用的移动属性
- 16.开源Flash 3D引擎Papervision3d
- 17.as3 判断鼠标滚轮前滚或后滚
- 18.js:行向上替换滚动效果
- 19.为什么要清净?(禅与佛)
- 20.扩展window.setTimeout方法
Statistics
Recent Comments
Archive
Links
Support
TOP



