unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.MediaLibrary, FMX.
Platform, System.Messaging,
FMX.Objects, FMX.StdCtrls, FMX.Controls.Presentation;
type
TForm1 =
class(TForm)
ToolBar1: TToolBar;
SpeedButton1: TSpeedButton;
ImageControl1: TImageControl;
procedure SpeedButton1Click(Sender: TObject);
private
procedure PhotoDidFinishTaking(Image:TBitmap);
procedure PhotoDidCancelTaking;
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.PhotoDidCancelTaking;
begin
// Was auch immer hier passieren soll
end;
procedure TForm1.PhotoDidFinishTaking(Image: TBitmap);
begin
ImageControl1.Bitmap.Assign(Image);
end;
procedure TForm1.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;
end.