Solved

FMX TCameraComponent Problem

Posted on 2016-11-28
2
92 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
On Beyond Tools A conversation I recently had with the DevOps manager of a major online retailer really made me think about DevOps monitoring tools (https://www.onpage.com/devops-incident-management-tool/). The manager and I discussed how sever…
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.

733 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