Y
ysp_1984
Unregistered / Unconfirmed
GUEST, unregistred user!
我想做一个通过IP地址监视其他电脑的屏幕情况。应该怎么做啊??
下面的代码可以获得本机的电脑的屏幕图像
procedure TfrmMain.CaptureScreen();
var
Fullscreen:Tbitmap;
FullscreenCanvas:TCanvas;
dc:HDC;
begin
Fullscreen:=TBitmap.Create;
//创建一个BITMAP来存放图像
Fullscreen.Width:=screen.width div 2;
Fullscreen.Height:=screen.Height div 2;
DC:=GetDC(GetDesktopWindow());
//取得屏幕的DC,参数0指的是屏幕
FullscreenCanvas:=TCanvas.Create;
//创建一个CANVAS对象
FullscreenCanvas.Handle:=DC;
Fullscreen.Canvas.CopyRect(Rect(0,0,screen.Width div 2,screen.Height div 2),
fullscreenCanvas,Rect(0,0,Screen.Width,Screen.Height));
//把整个屏幕复制到BITMAP中
FullscreenCanvas.Free;
//释放CANVAS对象
ReleaseDC(0,DC);
//释放DC
Image1.Picture.Bitmap:=fullscreen;
//拷贝下来的图像赋给IMAGE对象
Image1.Width:=fullscreen.Width;
Image1.Height:=fullscreen.Height;
fullscreen.free;
//释放bitmap
end;
下面的代码可以获得本机的电脑的屏幕图像
procedure TfrmMain.CaptureScreen();
var
Fullscreen:Tbitmap;
FullscreenCanvas:TCanvas;
dc:HDC;
begin
Fullscreen:=TBitmap.Create;
//创建一个BITMAP来存放图像
Fullscreen.Width:=screen.width div 2;
Fullscreen.Height:=screen.Height div 2;
DC:=GetDC(GetDesktopWindow());
//取得屏幕的DC,参数0指的是屏幕
FullscreenCanvas:=TCanvas.Create;
//创建一个CANVAS对象
FullscreenCanvas.Handle:=DC;
Fullscreen.Canvas.CopyRect(Rect(0,0,screen.Width div 2,screen.Height div 2),
fullscreenCanvas,Rect(0,0,Screen.Width,Screen.Height));
//把整个屏幕复制到BITMAP中
FullscreenCanvas.Free;
//释放CANVAS对象
ReleaseDC(0,DC);
//释放DC
Image1.Picture.Bitmap:=fullscreen;
//拷贝下来的图像赋给IMAGE对象
Image1.Width:=fullscreen.Width;
Image1.Height:=fullscreen.Height;
fullscreen.free;
//释放bitmap
end;