图片在数据库中是存储路径

解决方案 »

  1.   

    pictureBox1.Image=Image.FromFile("路径");
      

  2.   

    从数据库中用IO操作把图片读取出来,然后把这个流formater成对应的图片格式,然后赋给image
      

  3.   

    因为这个需要动态捆绑,
    我想把数据库中的图片捆绑在picturebox中,如下代码:
    cmAmend = (CurrencyManager) BindingContext[ds.Tables[0]];
    FileStream fs=new FileStream(str,System.IO.FileMode.Open,System.IO.FileAccess.Read);
    byte[] bytes=new byte[fs.Length];
    fs.Read(bytes,0,bytes.Length);
    fs.Close();
    MemoryStream ms=new MemoryStream(bytes);
    this.pictureBox1.Image=Image.FromStream(ms);
    如果这样动态捆绑的话,FileStream中的str怎么写啊
      

  4.   

    因为这个需要动态捆绑,
    我想把数据库中的图片捆绑在picturebox中,如下代码:
    cmAmend = (CurrencyManager) BindingContext[ds.Tables[0]];
    FileStream fs=new FileStream(str,System.IO.FileMode.Open,System.IO.FileAccess.Read);
    byte[] bytes=new byte[fs.Length];
    fs.Read(bytes,0,bytes.Length);
    fs.Close();
    MemoryStream ms=new MemoryStream(bytes);
    this.pictureBox1.Image=Image.FromStream(ms);
    如果这样动态捆绑的话,FileStream中的str怎么写啊