dc := GetDc(GetDesktopWindow);
Image1 := Timage.Create(self);
Image1.Width := GetDeviceCaps(
dc,HORZRES);
Image1.Height := GetDeviceCaps(
dc,VERTRES);
BitBlt(Image1.Canvas.Handle,0,0,Image1.Width,Image1.Height,
dc,0,0,SRCCOPY);
Image1.Canvas.Brush.Style := bsClear;
Image1.Canvas.Font.Color := clred;
jpeg := TJPEGImage.Create;
jpeg.Assign(Image1.Picture.Bitmap);
Stream:=TMemoryStream.Create;
ssize:=stream.size;
Image1.Picture.Bitmap.SaveToStream(Stream);
Stream.Position:=0;
ClientSocket1.Socket.SendBuf(ssize, SizeOf(ssize));
clientsocket1.socket.sendstream(Stream);
ReleaseDc(GetDesktopWindow,
dc);
Image1.Free;
jpeg.Free;
end;