Android 照相

XE6 控件太强了CameraComponent就可以了

 

CameraComponent1.Active := True;

procedure TCameraComponentForm.CameraComponent1SampleBufferReady(Sender: TObject; const ATime: Int64);
begin
  TThread.Synchronize(TThread.CurrentThread, GetImage);
  // imgCameraView.Width := imgCameraView.Bitmap.Width;
  // imgCameraView.Height := imgCameraView.Bitmap.Height;
end;


procedure TCameraComponentForm.GetImage;
begin
  CameraComponent1.SampleBufferToBitmap(imgCameraView.Bitmap, True);
end;


procedure TCameraComponentForm.btnSaveClick(Sender: TObject);
var
  filename: string;
begin
  filename := FormatDateTime(yymmddHHmmss, Now()) + .jpg;
  filename := TPath.GetPicturesPath + PathDelim + filename;
  imgCameraView.Bitmap.SaveToFile(filename);
end;

 

Android 照相,布布扣,bubuko.com

Android 照相

上一篇:Android——配置文件的保存SharedPreferences进行数据存储


下一篇:ITFriend网站内测公测感悟