Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
C#显示url图片
neoit
follow
0
7-7-2008 11:19 PM
103 views
tags:
.net
,
c#
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
Why do you post clips to clipmarks?
50 Great Free Online Libraries
VP Candidate Biden Is No Friend to File Sh...
Ajax Development India & Ajax Programming ...
Offshore Web Development Company
Saving the Internet
The Green Guide- green living
More clips from
neoit
蒜蓉粉丝蒸扇贝
你的孩子总是“回答正确”吗?
成年人的35个好习惯
Today's Top Clips
Shaking things up on Clipmarks.com
The bigges World Body painting Festival - Beautiful!
Wrong Woman; Wrong Message
Say wow! the flying jellyfish
10 Most Expensive Paintings in the World
A pit bull with lipstick is a good thing?
Futurese- English in 3000 AD
13 of the Coolest Art Installations in the History of Burning Man
7 Writing Habits of Amazing Writers
50 Great Free Online Libraries
visit the
Top Clips page
View the Top Clips from
July 7, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/d5588c80-cdb8-4899-acde-38a7eae012d6/E28DEC5F-FAB9-4C91-B744-3D1AAF4634EB/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://webtech.blog.techweb.com.cn/archives/2007/2007118164819.shtml" href="http://webtech.blog.techweb.com.cn/archives/2007/2007118164819.shtml" style="font-size: 11px;">webtech.blog.techweb.com.cn</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://webtech.blog.techweb.com.cn/archives/2007/2007118164819.shtml"><TR><TH>C#显示url图片</TH></TR><TR><TD class="isPost">webtech 发表于 2007-1-18 16:48:00</TD></TR><TR><TD class="content">private void GetUrlImage(string url)<BR /> { <BR /> WebClient client = new WebClient();<BR /> client.OpenReadCompleted +=new OpenReadCompletedEventHandler(client_OpenReadCompleted);<BR /> client.OpenReadAsync(new Uri(url));<BR /> }<BR /> void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)<BR /> {<BR /> Stream stream = e.Result;<BR /> this.pictureBox1.Image= Image.FromStream(stream); <BR /> }<BR /> <P><FONT face="Courier New"><DIV>C#下载图片修改后显示</DIV><BR /><FONT face="宋体"></FONT><BR /> <BR />using System.Net;<BR />using System.Drawing;</FONT></p> <P><FONT face="Courier New">//1、将原始图片下载下来:<BR />string url = "</FONT><A href="http://www.mozilla.org/images/feature-back-cnet.png"><FONT face="Courier New">http://www.mozilla.org/images/feature-back-cnet.png</FONT></A><FONT face="Courier New">";<BR />WebClient myWebClient = new WebClient();<BR />myWebClient.DownloadFile(url,"C:\\temp\\feature-back-cnet.png"); </FONT></p> <P><FONT face="Courier New">System.Drawing.Image image = System.Drawing.Image.FromFile("C:\\temp\\feature-back-cnet.png");<BR />Bitmap bmp = new Bitmap(image,new Size(100,100));</FONT></p> <P><FONT face="Courier New">//2.将新图片保存到 C:\temp\newPic.png<BR />bmp.Save("C:\\temp\\newPic.png",System.Drawing.Imaging.ImageFormat.Png);<BR /><DIV>Image1.ImageUrl = "C:\\temp\\newPic.png"; </DIV></FONT></P></TD></TR></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/E28DEC5F-FAB9-4C91-B744-3D1AAF4634EB/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Blog
Copyright
Privacy
EULA
OK