Winform綁定圖片的三種方式

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());網絡

相關文章
相關標籤/搜索