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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-12-18
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案