System.Drawing.Image img = System.Drawing.Image.FromFile(imgFilePath);
Byte[] bytesImg = imgToByteArray(img);
img.Dispose(); /*add this line after convert image to binary*/
public byte[] imgToByteArray(System.Drawing.Image img)
{
using (MemoryStream mStream = new MemoryStream())
{
img.Save(mStream, img.RawFormat);
return mStream.ToArray();
}
}