Solved

FMX TCameraComponent Problem

Posted on 2016-11-28
2
10 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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now