TakePhotoFromCameraAction1: TTakePhotoFromCameraAction; // 通过手机摄像头获取图片 TakePhotoFromLibraryAction1: TTakePhotoFromLibraryAction; //获取手机已存在图片 ShowShareSheetAction1: TShowShareSheetAction;//用其它程序分享图片(Bitmap.Assign();)
获取麦克风设置 FMX.Media FMicrophone: TAudioCaptureDevice; FMicrophone := TCaptureDeviceManager.Current.DefaultAudioCaptureDevice; FMicrophone.FileName 设置路径 FMicrophone.State = TCaptureDeviceState.Capturing 设备状态 FMicrophone.StartCapture; //开始录音 FMicrophone.StopCapture; // 结束录音 MediaPlayer: TMediaPlayer; 媒体播放器 MediaPlayer.FileName 设置路径 MediaPlayer.Play; // 开始播放 MediaPlayer.Stop; // 结束播放
获取手机摄像头 Camera: TCameraComponent; Camera.Active := True; //打开 Camera.Active := False; //停止 Camera.SampleBufferToBitmap(imgCameraView.Bitmap, True); //保存图片 TThread.Synchronize(TThread.CurrentThread, GetImage); //线程保存图片 Camera.Quality 图像质量 Camera.HasFlash 是否有闪光灯 Camera.TorchMode := TTorchMode.ModeOn; //打开闪光灯 Camera.FlashMode := FMX.Media.TFlashMode.fmFlashOff; Camera.TorchMode := TTorchMode.ModeOff;//关闭闪光灯 Camera.FlashMode := FMX.Media.TFlashMode.fmFlashOn; Camera.Kind := FMX.Media.TCameraKind.ckFrontCamera;//前置摄像头 Camera.Kind := FMX.Media.TCameraKind.ckBackCamera;//后置摄像头
|
请发表评论