private void send_img(Socket clientSocket, Bitmap image) {
int partSize = 65507; // тут лимит сокетов
int partsCount = (int)Math.Ceiling((double)image.Size.Width * image.Size.Height / partSize);
for (int i = 0; i < partsCount; i++) {
int x = (i * partSize) % image.Size.Width;
int y = (i * partSize) / image.Size.Width;
int width = Math.Min(partSize, image.Size.Width - x);
int height = Math.Min(partSize, image.Size.Height - y);
Rectangle rect = new Rectangle(x, y, width, height);
Bitmap part = image.Clone(rect, image.PixelFormat);
MemoryStream ms = new MemoryStream();
part.Save(ms, ImageFormat.Jpeg);
byte[] imagePart = ms.ToArray();
clientSocket.Send(imagePart);
}
}