工程是这样的:
要能同时截取局域网内最多16台计算机的屏幕,可以分为1、4、9、16屏,做到及时截取,我觉得应该先压缩图象再传送,这样才可以做到及时截取。
备注:本人非专业程序员,所以对于delphi还比较陌生,希望大家为我指点迷津,所为我提提意见,或者给我些代码的援助,本人不甚受恩感激!QQ22821727
要能同时截取局域网内最多16台计算机的屏幕,可以分为1、4、9、16屏,做到及时截取,我觉得应该先压缩图象再传送,这样才可以做到及时截取。
备注:本人非专业程序员,所以对于delphi还比较陌生,希望大家为我指点迷津,所为我提提意见,或者给我些代码的援助,本人不甚受恩感激!QQ22821727
Windows, Messages,jpeg,extctrls, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,Clipbrd,printers, Buttons, Menus;type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
procedure DisPic;
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}function GetDeskTopPic:Tbitmap;
var
tyRect :TRect;
iWidth,iHeight:integer;
aBitMap:TBitMap;
aHandle:Thandle;
iDC:LongWord;
begin
aHandle:=GetDesktopWindow;
iDC:=GetDC(aHandle); GetWindowRect(aHandle,tyRect);
iWidth:=tyRect.Right-tyRect.Left;
iHeight:=tyRect.Bottom-tyRect.Top;
//iWidth:=354;
//iHeight:=288;
ABitmap:=TBitmap.Create;
ABitmap.Width := iWidth;
ABitmap.Height := iHeight;
//ABitmap.PixelFormat:=pf8bit;
bitblt(aBitMap.Canvas.Handle,0,0,iWidth,iHeight,iDC,tyRect.Left,tyRect.Top,SRCCOPY); ReleaseDC(AHandle,iDC);
result:=abitmap;
//aBitmap.SaveToFile('h:\abcd.bmp');
abitmap.FreeImage;end;procedure TForm1.DisPic;
var
jpgPic:TJpegImage;
begin
jpgPic:=TJpegImage.Create;
//jpgPic.PixelFormat:=jf8Bit;
jpgPic.Assign(GetDeskTopPic);
image1.Picture.Assign(jpgPic);
jpgPic.SaveToFile('h:\abcd.jpg');
jpgPic.Free;end;procedure TForm1.N2Click(Sender: TObject);
begin
DisPic;
end;procedure TForm1.N3Click(Sender: TObject);
begin
Timer1.Enabled:=true;
end;procedure TForm1.N4Click(Sender: TObject);
begin
Timer1.Enabled:=false;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
DisPic;
end;end.这是偶写的屏幕抓图,也许对你有用,不过我用的效果不理想,如果频繁刷新的话
这里的东东对你一定有用