picturebox,filestream,memorystream RRS feed

  • Question

  • suppose i want to
    1)get the image of a picturebox and pass it to filestream
    2) then pass it to memorystream.

    Code Snippet

    i have tried this codes:

     MemoryStream ms = new MemoryStream();

     FileStream fs=new FileStream(fileName.ToString(),FileMode.Open);  //fileName = camCapture.FileName  ,camCapture is Camera Capture Dialogue

     pictureBox1.Image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg);

    i 'm not sure how to pass the value of filestream to memorystream in order to use memorystream.toArray. 

    thanks in advance
    Friday, July 6, 2007 7:20 AM


  • Code Snippet
    int length = Convert.ToInt32(fs.Length);
    MemoryStream ms = new MemoryStream(length);


    Friday, July 6, 2007 7:27 AM