im just using a faster method to convert image to byte array it's not new i found it in some places over the internet.
this is the send code
private int SendVarData(Socket s, byte[] data)
{
total = 0;
int size = data.Length;
int dataleft = size;
int sent;
datasize = BitConverter.GetBytes(size);
sent = s.Send(datasize);
sent = s.Send(data, total, dataleft, SocketFlags.None);
total += sent;
dataleft -= sent;
// MessageBox.Show("D");
return total;
}
and i call it :
SendVarData(handler, bmpBytes);
where handler is a socket and bmpbytes is the image converted to byte array. do u have any better solution? @xanatos
jpgor agifimage that is compressed... Try saving it to abmpand see the size.