Capture Layar - Lazarus

Keterangan Gambar : Lazarus Free Pascal
procedure TForm1.Capture(Sender: TObject);
var
MyPNG: TPortableNetworkGraphic;
FileName: string;
nfile: string;
R: TRect;
begin
nfile := extractfilepath(application.ExeName);
MyPNG := TPortableNetworkGraphic.Create;
try
R := Rect(0, 0, grid.Width, grid.Height);
MyPNG.SetSize(grid.Width, grid.Height);
MyPNG.Canvas.CopyRect(R, grid.Canvas, R);
// Get the name of the file to be created from the user
FileName := 'Screenshot_' + FormatDateTime('dddd-mm-dd-yyyy-hhnnss', Now());
MyPNG.SaveToFile(Format(nfile + '%s.png', [FileName]));
finally
MyPNG.Free;
end;
end;

Write a Facebook Comment
Komentar dari Facebook
View all comments