Sending image through socket

Hi everyone,

I’m loading a small portion (rectangle), of a png file and extracting the ARGB (Alpha, Red, Green, Blue) values of the bitmapdata using C#.

I then send this bytearray to the flash player (using sockets).

The flash player receives this as a ByteArray.

I then use LoadBytes but it gives me the error “unknown file type”.

I’m guessing that it could be because the data is not png encoded (I don’t know how to do it), and loadBytes requires that.

Can anyone please tell me how to do this?

**My ultimate aim, is to transfer an image from on app (C# based), to the flash player, (WITHOUT using urls) using sockets. **

If there’s an easier way PLEASE feel free to suggest.