Bhavesh Vankar

Bhavesh Vankar

  • 684
  • 1.1k
  • 78.4k

image to binary convert from webcam capture in web c#

Oct 26 2020 7:25 AM
hello I have try to convert captured image by webcam into binary format and want to save it in sql server nut its getting error like
"Additional information: Could not find a part of the path 'C:\VisiterManagment\VisiterManagment\CroppedImage\'."
below I tried code to convert image to binary.
 
  1. public static byte[] ImageToBinary(string _imgpath)    
  2. {    
  3.     FileStream fS = new FileStream(_imgpath, FileMode.Open, FileAccess.ReadWrite);    
  4.     byte[] b = new byte[fS.Length];    
  5.     fS.Read(b, 0, (int)fS.Length);    
  6.     fS.Close();    
  7.     return b;    
  8. }    
 

Answers (1)