pictrue获取图片的三种方式
生活随笔
收集整理的這篇文章主要介紹了
pictrue获取图片的三种方式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.絕對路徑:?
this.pictureBox2.Image=Image.FromFile("D:\\001.jpg");?
2.相對路徑:?
Application.StartupPath;??
可以得到程序根目錄??
this.pictureBox2.Image=Image.FromFile(Application.StartupPath "\\1.gif");?
3.獲得網絡圖片的路徑?
this.pictureBox2.Image= Image.FromStream(System.Net.WebRequest.Create(http://www.pxkt.com/logo.gif).GetResponse().GetResponseStream());
this.pictureBox2.Image=Image.FromFile("D:\\001.jpg");?
2.相對路徑:?
Application.StartupPath;??
可以得到程序根目錄??
this.pictureBox2.Image=Image.FromFile(Application.StartupPath "\\1.gif");?
3.獲得網絡圖片的路徑?
this.pictureBox2.Image= Image.FromStream(System.Net.WebRequest.Create(http://www.pxkt.com/logo.gif).GetResponse().GetResponseStream());
?
轉載于:https://www.cnblogs.com/NirvanaCn/p/5215186.html
總結
以上是生活随笔為你收集整理的pictrue获取图片的三种方式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ACM/ICPC2014鞍山现场赛E h
- 下一篇: ajax跨域解决方案