我需要创建两个程序:
服务器向客户端发送请求,然后客户端使用此功能接收请求并捕获屏幕:
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;
之后,客户端将位图发送到服务器。
有人能帮我吗?
编辑添加:
我有一些例子:
最佳答案
关于delphi - 谁能举个使用套接字发送文件的例子吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5847084/