Thema: Delphi ACamera - winsoft

Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#6

AW: ACamera - winsoft

  Alt 6. Mär 2018, 23:14
Ok, I got it solved.

Delphi-Quellcode:

procedure TFormMain.ButtonTakePictureClick(Sender: TObject);
begin
  ACamera.FocusMode := foAuto;
  ACamera.AutoFocus; // call onAutoFocus
end;

procedure TFormMain.ACameraAutoFocus(Sender: TObject; Success: Boolean);
begin
  if success = True then // when it is focused then Take Picture
  begin
    ACamera.TakePicture;
  end;
end;

procedure TFormMain.ACameraPictureTaken(Sender: TObject; Data: TArray<System.Byte>);
begin
  TFile.WriteAllBytes(TPath.Combine(dirImages, edName.Text + '.jpg'), Data);
end;
Daniel
  Mit Zitat antworten Zitat