I am working on Windows Phone and I need to convert the images in the phone to a byte array, but the problem is that VisualStudio throws an OutOfMemory exception.
Is there any way to avoid this error? Or an alternative way?
public static byte[] GetBytes(Picture p)
{
byte[] buffer=new byte[p.GetImage().Length];
p.GetImage().Read(buffer, 0, buffer.Length);
return buffer;
}