Delphi Can
Fotoğraf çekmek - Baskı Önizleme

+- Delphi Can (https://www.delphican.com)
+-- Forum: Delphi (https://www.delphican.com/forumdisplay.php?fid=3)
+--- Forum: Mobil Platform - FireMonkey (FMX) (https://www.delphican.com/forumdisplay.php?fid=7)
+--- Konu Başlığı: Fotoğraf çekmek (/showthread.php?tid=957)



Fotoğraf çekmek - quiet1day - 08-05-2017

procedure TFotoForm.Button1Click(Sender: TObject);
begin
CameraComponent.Active := True;
end;

procedure TFotoForm.CameraComponentSampleBufferReady(Sender: TObject;
 const ATime: TMediaTime);
begin
     TThread.Synchronize(TThread.CurrentThread, GetImage);
end;

procedure TFotoForm.GetImage;
begin
 CameraComponent.SampleBufferToBitmap(imgCameraView.Bitmap, True);
end;

kodlarını kullanarak image nesnesine Camerayı aktarıyorum  bir butona fotoğraf çekmek işlemini nasıl yapaarız

amacım form üzerinden çekim yapmak


Fotoğraf çekmek - mcuyan - 11-05-2017

procedure TForm3.Button1Click(Sender: TObject);
var
 image: tbitmap;
 img: tbitmap;
begin
 try
   image := tbitmap.Create;
   image := imgCameraView.Bitmap;
   img := image.CreateThumbnail(600, 800);
   if image1.Bitmap.IsEmpty then
     image1.Bitmap := img
   else
   begin
     FMX.Dialogs.MessageDlg
       ('Resim çekme hakkınız doldu. Çekilenleri silip yeniden çekmek istiyor musunuz?',
       TMsgDlgType.mtConfirmation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0,
       procedure(const AResult: TModalResult)
       begin
         if AResult = mrYes then
         begin
           image1.Bitmap.Assign(nil);
         end;
       end);
   end;
   image.free;
 except
   on e: exception do
   begin
     // CameraComponent1.Active:= false;
     showmessage(e.Message);
   end;
 end;