using (MemoryStream mem = new MemoryStream(data))
{
System.Drawing.Image imgPhoto = System.Drawing.Image.FromStream(mem);
}
This is the code that I am using . The problem is that as soon as that debugger processes this line :
System.Drawing.Image imgPhoto = System.Drawing.Image.FromStream(mem);
It gives an error parameter invalid . So after I checked the parameters for "mem" while it is debugging , I noticed that the position parameter is setting to zero every time .
I noticed one more thing here : when I am receiving images from sources beginning with url :
The position parameter is not setting to some value and always setting to zero and that's the time when I am getting the error . Please refer the screen shot .
But for images beginning with URL : ... The position parameter is setting some value . Please refer the screenshot .