I want to convert an image to bytes for server upload. So, I have used the below code which is throwing error. Can anyone please help me out?
Error: “Reference to type ‘system.componentmodel.typeconverter’ claims it is defined assembly system but it could not be found".
public static byte[] imgToByteConverter(System.Drawing.Image inImg)
{
ImageConverter imgCon = new ImageConverter();
return (byte[])imgCon.ConvertTo(inImg, typeof(byte[]));
}