unit WebcamMain;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Media, FMX.Objects,
FMX.Controls.Presentation, FMX.StdCtrls;
type
TForm1 =
class(TForm)
imgCamera: TImage;
cam: TCameraComponent;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure camSampleBufferReady(Sender: TObject;
const ATime: TMediaTime);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
begin
Cam.Kind := TCameraKind.
Default;
Cam.OnSampleBufferReady := camSampleBufferReady;
Cam.Active := true;
end;
procedure TForm1.camSampleBufferReady(Sender: TObject;
const ATime: TMediaTime);
begin
TThread.synchronize(TThread.CurrentThread,
Procedure
Begin
cam.SampleBufferToBitmap(imgCamera.Bitmap, true);
End
);
end;
end.