惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 我本无名

asp.net中repeater嵌套CheckBoxList,RadioButtonList来完成投票 javascript中setTimeOut 和setInterval的区别 在不同页面之间传递参数 循环不间断显示滚动图片 解决"当前命令发生了严重错误。应放弃任何可能产生的结果。"的问题 - 我本无名 - 博客园 一个不错的,JavaScript代码,显示首页图片幻灯片效果 一个计算数值并进行排序的SQL语句 解决javascript里的中文信息是乱码的问题 javascript特效,信息滚动效果 关于水晶报表的多表显示 水晶报表的使用(VS2003+CR9) 关于“响应在此上下文中不可用” 中文VS2008中安装ASP.NET MVC框架,不显示模板 关于split中字符串的问题 OnClientClick的妙用! 一条SQL语句 如何进行软件需求分析 软件需求分析规格说明书格式 (转载)悟透JavaScript
asp.net上传图片后,在图片上加入自己的背景字 - 我本无名 - 博客园
我本无名 · 2008-05-22 · via 博客园 - 我本无名

有时候我们在上传完一些自己的特殊图片后,想在别人传载的时候,可以表显出出自何方。这时我们就要在图片上加入一些背景字。下面给出我的代码
前台:  

<div>
    
        
<asp:Image ID="Image1" runat="server" Height="305px" Width="312px" />
        
<asp:FileUpload ID="FileUpload1" runat="server" Width="243px" />
        
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="上传图片" />
    
</div>

后台:

protected void Button1_Click(object sender, EventArgs e)
        {
            
string FileName;
            
string FileName1;
            
string FilePath;

            FileName 

= this.FileUpload1.PostedFile.FileName;
            FileName1 
= FileName.Substring(FileName.LastIndexOf("\")+1);
            FilePath 
= Request.PhysicalApplicationPath + "images\";
            
this.FileUpload1.PostedFile.SaveAs(FilePath + FileName1);

            System.Drawing.Image image1 

= System.Drawing.Image.FromFile(Server.MapPath("/images/" + FileName1));
            System.Drawing.Image NewImage 
= new Bitmap(image1.Width, image1.Height, PixelFormat.Format24bppRgb);
            Graphics g 
= Graphics.FromImage(NewImage);
            g.DrawImage(image1, 
00, image1.Width, image1.Height);
            Font f 
= new Font("楷书"int.Parse("28"));
            Brush b 
= new SolidBrush(Color.Red);
            g.DrawString(
"无名背景字", f, b, 10140);
            g.Dispose();
            System.Drawing.Image thubimages 
= NewImage.GetThumbnailImage(500500null,System.IntPtr.Zero);
            image1.Dispose();
            thubimages.Save(FilePath 
+ FileName1, ImageFormat.Jpeg);
            
this.Image1.ImageUrl = "/images/" + FileName1;
        }

试一下效果,你可以根据你的需求,来改变字的大小与色彩