已知图片路径,如"\12.jpg",有什么方法直接取得byte[]类型的数据

解决方案 »

  1.   

    Dim ms As New MemoryStream()
    PictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)
    Dim arrImage() As Byte = ms.GetBuffer
    ms.Close()
      

  2.   

    string s = "ddd";
    byte[] b = System.Text.Encoding.Default.getBytes(s);
      

  3.   

    string s = "ddd";
    byte[] b = System.Text.Encoding.Default.getBytes(s);
      

  4.   


    path=Server.MapPath("/12.jpg");byte1 = System.Text.Encoding.Default.GetBytes(path);
    显示byte1数据,未能显示图片drk928(一起看斜阳)的PictureBox1指的是什么?请各位大侠帮帮忙,急啊
      

  5.   

    FileStream fs=new FileStream (Server.MapPath("1.jpg"),FileMode.Open);
    byte[] buffer=new byte [fs.Length];
    fs.Read(buffer,0,Convert.ToInt32(fs.Length));
    Response.BinaryWrite(buffer);
      

  6.   

    谢谢,vivianfdlpw() 
    我用ASPJPEG组件压缩 高>宽的图片,会变型(如576*1704-->500*375),不知道大家有没遇过,