Little Helper
Little Helper

Reputation: 2456

Can anyone give example of using sockets to send file?

I need to create two programs:

  1. Server
  2. Client

The server sends request to client, then the client receives request and captures the screen using this function:

function GetScreenShot(PixelFormat:TPixelFormat;Width,Height:Integer): TBitmap;
var
  Desktop: HDC;
begin
  Result  := TBitmap.Create;
  Desktop := GetDC(GetDesktopWindow);
  try
    try
      Result.PixelFormat := PixelFormat;
      Result.Width := Width;
      Result.Height := Height;
      BitBlt(Result.Canvas.Handle, 0, 0, Result.Width, Result.Height, Desktop, 0, 0, SRCCOPY);
      Result.Modified := True;
    finally
      ReleaseDC(0, Desktop);
    end;
  except
    Result.Free;
    Result := nil;
  end;
end;

After that client sends bitmap to server.

Can someone help me?


Edited to add:

I have some examples:

Upvotes: 1

Views: 1804

Answers (1)

RBA
RBA

Reputation: 12584

have you tried this example http://delphi.about.com/od/internetintranet/l/aa012004a.htm ?

Upvotes: 1

Related Questions