1. private System.Windows.Forms.PictureBox pictureBox1;this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;   
  2. this.pictureBox1.ImageLocation = "http://www.microsoft.com/h/en-us/i/ts_1024_25_KidsandSpyware.jpg";   
  3. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;  

在WinForm 2.0下,新增加的ImageLocation属性支持文件系统或者Web上的图像位置。这使得显示一个源自万维网上图像的任务变得十分简单。

PictureBox的SizeMode属性的类型是枚举型PicturBoxSizeMode,在1.x下有Autosize, CenterImage, Normal和StretchImage四个值。WinForm 2.0中新增加了Zoom,这个模式下图像在根据PictureBox大小缩放的时候保持纵横比(aspect ratio)

 



相关文章:

  • 2021-09-06
  • 2021-06-28
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-25
  • 2021-08-28
  • 2021-08-16
  • 2021-08-13
  • 2022-12-23
相关资源
相似解决方案