【例子介绍】Delphi7 画面撷取,存成 jpg 档,可放在系统管理批处理程式cmd/bat,寄给系统管理人员
【相关图片】
【源码结构】
program ScreenShot;
{$APPTYPE CONSOLE}
uses
SysUtils,
jpeg,
Forms,
uscreencap in 'uscreencap.pas';
var
sPara1 : String;
ajpeg : TJPEGImage;
begin
{ TODO -oUser -cConsole Main : Insert code here }
if ParamCount>0 then // 是否有參數
begin
sPara1 := ParamStr(1); // 指定檔名
ajpeg:=TJPEGImage.Create;
try
CaptureScreenShotJPEG(ajpeg);
ajpeg.SaveToFile(sPara1);
finally
ajpeg.Free;
end
end
else
begin
writeln('Usage, Ex: ' ExtractFileName(Application.ExeName) ' c:\filename.jpg ');
sleep(3000);
end;
end.
.
├── ScreenShot
│ ├── ScreenShot.cfg
│ ├── ScreenShot.dof
│ ├── ScreenShot.dpr
│ ├── ScreenShot.exe
│ ├── ScreenShot.~dpr
│ ├── uscreencap.dcu
│ ├── uscreencap.pas
│ └── uscreencap.~pas
└── 5t6t网_ScreenShot.zip
1 directory, 9 files
评论