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());
自適應大小屬性:BackGroundImageLayout=Stretch,SizeMode=StretchImage