We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

FMX CameraService - TParamsPhotoQuery NeedSaveToAlbum not working

Roger Alcindor
on
24 Views
Last Modified: 2020-12-10
I am testing an application using an android tablet to take photo images and send the binary image (bitmap format) to a TCP server on a PC. I am using Embarcadero XE 10.1 in an FMX application.
The code is working fine except that I don't want the photo images to be saved on the Android tablet Camera album.
The code allows for this and has been copied from an example and is shown below where the statement params.NeedSaveToAlbum = false; is supposed to stop the image from being saved but it doesn't seem to have any effect as the images are saved on the android device.
What am I doing wrong ?
I got the example code from ​FMX CameraService​​​

void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
 _di_IFMXCameraService service;
 TParamsPhotoQuery params;
 if (TPlatformServices::Current->SupportsPlatformService
  (__uuidof(IFMXCameraService)) && (service =
  TPlatformServices::Current->GetPlatformService
  (__uuidof(IFMXCameraService)))) {
  params.Editable = true;
  // Specifies whether to save a picture to device Photo Library
  params.NeedSaveToAlbum = false;
  params.RequiredResolution = TSize(640, 640);
  params.OnDidFinishTaking = DoDidFinish;
  service->TakePhoto(SpeedButton1, params);
 }
 else {
  ShowMessage("This device does not support the camera service");
 }
}

Comment
Watch Question
This question hasn't been answered yet.
While you wait, find out how you can maximize your capability with the most trusted tool in IT.
Explore More Ask a Question
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE