Starten, Button drücken, Foto machen und übernehmen, Bild anschauen.
Delphi-Quellcode:
type
TForm1 = class( TForm )
SpeedButton1: TSpeedButton;
ImageControl1: TImageControl;
procedure SpeedButton1Click(Sender: TObject);
private
procedure PhotoDidFinishTaking(Image:TBitmap);
procedure PhotoDidCancelTaking;
end;
procedure TCameraComponentForm.PhotoDidCancelTaking;
begin
// Was auch immer hier passieren soll
end;
procedure TCameraComponentForm.PhotoDidFinishTaking(Image: TBitmap);
begin
ImageControl1.Bitmap.Assign(Image);
end;
procedure TCameraComponentForm.SpeedButton1Click(Sender: TObject);
var
service : IFMXCameraService;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXCameraService,service) then
begin
service.TakePhoto(
nil,
TSize.Create(200,200),
False,
PhotoDidFinishTaking,
PhotoDidCancelTaking );
end;
end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ea 0a 4c 14 0d b6 3a a4 c1 c5 b9
dc 90 9d f0 e9 de 13 da 60)