逃跑计划天天向上:Asp.net(C#)给图片加上水印效果
来源:百度文库 编辑:九乡新闻网 时间:2024/10/06 18:05:29
if (FileUpload1.PostedFile.ContentType.ToLower().IndexOf("image") < 0)
2 {
3 FunctionUtility.JavaScriptHelper.Alert("上传的文件格式不正确!");
4 return;
5 }
6
7 Stream oStream = FileUpload1.PostedFile.InputStream;
8 System.Drawing.Image oImage = System.Drawing.Image.FromStream(oStream);
9
10 if(CheckBox1.Checked)
11 {
12 //加文字水印
13 Graphics g = Graphics.FromImage(oImage);
14 g.DrawImage(oImage, 0, 0, oImage.Width, oImage.Height);
15 Font f = new Font("Verdana",15);
16 Brush b = new SolidBrush(Color.White);
17 g.DrawString("http://www.itwealth.cn制作", f, b, 0, oImage.Height - 30);
18 g.Dispose();
19 }
20 else
21 {
22 //加图片水印
23 System.Drawing.Image copyImage = System.Drawing.Image.FromFile(Server.MapPath("/DesignImages/Images/SYT/Admin.jpg"));
24 Graphics g = Graphics.FromImage(oImage);
25 g.DrawImage(copyImage, new Rectangle(oImage.Width - copyImage.Width, oImage.Height - copyImage.Height, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
26 g.Dispose();
27 }
28
29 string setFileName = FunctionUtility.FileHelper.GetDateTimeFileName() + ".jpg";
30 string oFullName = Server.MapPath("/DesignImages/Images/SYT/" + setFileName);
31 oImage.Save(oFullName, System.Drawing.Imaging.ImageFormat.Jpeg);
32 oImage.Dispose();
33
34 Image1.Visible = true;
35 Image1.ImageUrl = "/DesignImages/Images/SYT/" + setFileName;
36 FunctionUtility.JavaScriptHelper.Alert("水印加载成功!"); 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/masky5310/archive/2009/11/22/4852110.aspx
2 {
3 FunctionUtility.JavaScriptHelper.Alert("上传的文件格式不正确!");
4 return;
5 }
6
7 Stream oStream = FileUpload1.PostedFile.InputStream;
8 System.Drawing.Image oImage = System.Drawing.Image.FromStream(oStream);
9
10 if(CheckBox1.Checked)
11 {
12 //加文字水印
13 Graphics g = Graphics.FromImage(oImage);
14 g.DrawImage(oImage, 0, 0, oImage.Width, oImage.Height);
15 Font f = new Font("Verdana",15);
16 Brush b = new SolidBrush(Color.White);
17 g.DrawString("http://www.itwealth.cn制作", f, b, 0, oImage.Height - 30);
18 g.Dispose();
19 }
20 else
21 {
22 //加图片水印
23 System.Drawing.Image copyImage = System.Drawing.Image.FromFile(Server.MapPath("/DesignImages/Images/SYT/Admin.jpg"));
24 Graphics g = Graphics.FromImage(oImage);
25 g.DrawImage(copyImage, new Rectangle(oImage.Width - copyImage.Width, oImage.Height - copyImage.Height, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
26 g.Dispose();
27 }
28
29 string setFileName = FunctionUtility.FileHelper.GetDateTimeFileName() + ".jpg";
30 string oFullName = Server.MapPath("/DesignImages/Images/SYT/" + setFileName);
31 oImage.Save(oFullName, System.Drawing.Imaging.ImageFormat.Jpeg);
32 oImage.Dispose();
33
34 Image1.Visible = true;
35 Image1.ImageUrl = "/DesignImages/Images/SYT/" + setFileName;
36 FunctionUtility.JavaScriptHelper.Alert("水印加载成功!"); 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/masky5310/archive/2009/11/22/4852110.aspx
Asp.net(C#)给图片加上水印效果
用Photoshop给图片加上水印的方法
48-简单给夜景图片加上星光效果
PhotoShop快速给夜景图片加上星光效果
.NET (C#) Internals: ASP.NET 应用程序与页面生命周期
【给pp加上水印吧-------水印制作】-尼康P100论坛-ZOL中关村在线
PS如何给图片添加防盗水印 -
PS如何给图片添加防盗水印
怎样用Photoshop给图片批量加水印
世界上没有绝对的安全,建议在我们的身份证图片上加上防盗水印
Photoshop给风景图片加上飘渺艺术效果
[ps教程]Photoshop给风景图片加上飘渺艺术效果
Asp.Net性能优化
优化 asp.net
asp.net 开发快捷键
Asp.Net无缝滚动
ASP.NET超时设置
C#反射教程(2)--Asp.Net/C#/WCF--编程设计网
C#反射教程(3)--Asp.Net/C#/WCF--编程设计网
ASP.NET(C#)页面间传值的常见方法 - acefly的专栏 - CSDNBlog
Photoshop给图片照片加上眩丽背景3
Photoshop给图片照片加上眩丽背景【20110507】
如何给图片加上别具一格的边框特效代码【1】
PS给图片加上漫天飞舞的动态雪花教程