Ver Mensaje Individual
  #7  
Antiguo 27-05-2013
CCCP CCCP is offline
Miembro
 
Registrado: dic 2004
Ubicación: Barcelona
Posts: 38
Reputación: 0
CCCP Va por buen camino
webcam

procedure TForm1.FormCreate(Sender: TObject);
begin
VideoCamera := TCaptureDeviceManager.Current.DefaultVideoCaptureDevice;
if VideoCamera <> nil then Begin
VideoCamera.OnSampleBufferReady := SampleBufferReady;
VideoCamera.StartCapture;
End;
end;

procedure TForm1.SampleBufferReady(Sender: TObject; const ATime: TMediaTime);
begin
TThread.Synchronize(TThread.CurrentThread, SampleBufferSync);
end;

procedure TForm1.SampleBufferSync;
begin
VideoCamera.SampleBufferToBitmap(Image1.Bitmap, True);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
if VideoCamera <> nil then VideoCamera.StopCapture;
end;
Responder Con Cita