直接在设计器里将ImageLocation 的值填为http://localhost/photo/front20101229063804.jpg就可以正常显示
在窗体load事件里写
this.pictureBox1.ImageLocation = "http://localhost/photo/front20101229063804.jpg";
显示不了图片怎么回事呢,要怎么解决

解决方案 »

  1.   

    调用load 方法改写
    PictureBox.Load ("")  
     
      

  2.   

    this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;模式设置了吗?
      

  3.   

    To wuyq11:还是一个大叉To windhuan:请仔细看问题,谢谢
      

  4.   

    据图片的URL创建一个流(Stream)接着调用Image.FromStream载入图片,最后关闭流。
    使用try
            {
                using (Stream stream = new FileStream(fileName, FileMode.Open))
                {
                    image = Image.FromStream(stream);
                }
                TextureBrush brush = new TextureBrush(image);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
    看看
      

  5.   

    private System.Windows.Forms.PictureBox pictureBox1;this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;   
    this.pictureBox1.ImageLocation = "http://localhost/photo/front20101229063804.jpg";
      
    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)
      

  6.   

    兄弟,我的可以啊:pictureBox1.ImageLocation = "http://c.csdn.net/bbs/t/5/i/pic_logo.gif";
      

  7.   

    To sxldfang
    你这个代码写在什么地方啊
      

  8.   

    this.pictureBox1.Image= bitmap.fromfile("http://localhost/photo/front20101229063804.jpg");不太懂C#语法,可能路径要加什么@符号
      

  9.   


    在 form 的 load 事件中啊!