Search code examples
c#androidsocketsbitmapbitmapfactory

How to send screenshots from C# server to android client?


I created socket connection between Server and Android Client and sent Images as byte Array but I can't find a way to decode byte Array in android.

Every time I try Image = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); I get errors like

SkAndroidCodec:: NewFromStream returned null

unknown bmp header format


Solution

  • Is the screenshot data from in proper format? Try saving the screenshot to a file and read the raw bytes from the file and send it to the server.