?
Solved

FMX TCameraComponent Problem

Posted on 2016-11-28
2
Medium Priority
?
130 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Subrat (C++ windows/Linux) earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

771 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