Solved

FMX TCameraComponent Problem

Posted on 2016-11-28
2
70 Views
Last Modified: 2016-11-30
I am using the Embarcadero Demo program for the FMX TCameraComponent control which is targeted on an Android device (Samsung T700 Tablet).
I am using Embarcadero C++ Builder XE 10.1 Berlin, Update 2, Enterprise edition.
I have added an extra line of code in the button-click event handler which activates the camera but a compiler error is generated at his line of code as shown below.
How do I set the camera to auto-focus ?
Code:
void __fastcall TCameraComponentForm::btnStartCameraClick(TObject *Sender)
{
      // Turn on the Camera
      CameraComponent->Active = True;
      CameraComponent->FocusMode = ContinuousAutoFocus;// <--- new line of code added here
      tbControl->TabIndex = 1;
}
Error message:
[bccaarm Warning] uMain.cpp(92): 6 enumeration values not handled in switch: 'FinishedLaunching', 'BecameActive', 'WillBecomeForeground'...
0
Comment
Question by:alcindor
2 Comments
 
LVL 8

Accepted Solution

by:
Subrat (C++ windows/Linux) earned 500 total points
ID: 41906266
I feel it is a warning not error.
You have not handled all the possible enum values in your switch case and might be not default case written.

If possible, Can you copy past some of the lines from 90 to 100 of uMain.cpp
Want to see line 92 statement.
0
 
LVL 2

Author Comment

by:alcindor
ID: 41908029
You are correct, There was also an error message but I mistakenly picked up on the warning message. I corrected the cause of the error message (elsewhere) and the warning persisted but the code ran without any error. I subsequently added a default case in the switch statement which handled the previously un-handled values.

Thanks for your help,

Roger

      switch (AAppEvent) { // line #92
            case TApplicationEvent::WillBecomeInactive:
            case TApplicationEvent::EnteredBackground:
            case TApplicationEvent::WillTerminate:
                  CameraComponent->Active = false;
                  return true;
                  break;
            default: //  added to remove warning
                break;
      }
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More and more people are using the enhanced small form-factor pluggable (SFP+) tranceivers, and speed is of utmost importance. Testing of speeds are critical to ensure that the devices will meet the speed requirements. There are some testing challen…
I have purchased two new systems and both are now Universal Extensible Firmware Interface (UEFI) based. UEFI is replacing BIOS for the desktop PC. It is a Linux based firmware with enough robustness it can communicate with a website without loading …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question