Jump to content
Sign in to follow this  
Mike James

Problems with FMX.CameraComponent Sample

Recommended Posts



I'm trying out the FMX.CameraComponent Sample with Delphi 10.4 Sydney. The project is the latest download from github.

When running the camera every so often the screen will flash green i.e. blank.

Has anybody else seen this? Is it a problem with the threading that the example is using?


Regards, Mike.

Share this post

Link to post

No problem seen yet, what Platform are you talking about ?

Share this post

Link to post
5 hours ago, Rollo62 said:

No problem seen yet, what Platform are you talking about ?

I'ts running on a Samsung a71 (Android 10).


Regards, Mike.

Share this post

Link to post

Hi Mike, i have the same problem, but my screen turn black and the app crash, did you solve the problem? thanks

Share this post

Link to post
Posted (edited)

Since there were several questions that this sample doesn't work, I checked myself again.

Indeed, it seems to be broken, out-of-the-box.


I did the following to get it running:

- re-create the project under Rx10.4

- add the Main unit to the project

- check the Project/Forms tab, the main form should be auto-created

- Removing all unnecessary permissions and entitlements, keeping just Camera permission

- For some reason in uMain.pas, this line needed to be added.

  I have not cxhecked the orginal file again, but maybe there was some non-standard form creation.

//21.08.20 added
    CameraComponentForm : TCameraComponentForm;

- For testing before, I moved the first creation, until the Camera shall be really started.
  This shouldn't be necessary, but I did that for testing to decouple the actions a little, und keep it in my final.

   That means you have to press START twice,  1. Get Resolutions,  2. Start camera

procedure TCameraComponentForm.FormCreate(Sender: TObject);
//21.08.20  PermissionsService.RequestPermissions([PermissionCamera], AccessCameraPermissionRequestResult, DisplayRationale);


procedure TCameraComponentForm.btnStartCameraClick(Sender: TObject);
  //21.08.20 Try  get resolutions here at first
  if cbResolutions.Items.Count = 0 then
      PermissionsService.RequestPermissions([PermissionCamera], AccessCameraPermissionRequestResult,   DisplayRationale)
  else //only then start the camera with 2nd click
      PermissionsService.RequestPermissions([PermissionCamera], ActivateCameraPermissionRequestResult, DisplayRationale);

Et voilâ, camera is working for me.



I made some comments already, that I think the non-working samples and demos are a MAJOR SHOWSTOPPER,

especially for new customers.

If Embarcadero is making a trial, and CE version, they should better take most care that all samples will run out-of-the-box.


If new customers trying new tools are a little bit like me,

I will DROP the new tools immediately if I cannot get the basic demos and hello worlds running without major quirks.

Thats my proof or quality for any software or tool.


So its Embarcadero's marketing decision, not mine.









Edited by Rollo62
  • Like 2

Share this post

Link to post

I've been checking on the net and it seems to be a problem with TCameraComponent and Threading.

I'll guess I'll have to wait for Delphi 10.4.1 or 10.5 :-)


Regards, Mike.

Share this post

Link to post

You can try what I explained before.

Has same issues as you described, re-creating solved those issues.

That means very likely the project and its libraries where not updated to 10.4, you can also try project manager "revert to default",

but I always rebuild a new project, which is most reliable.

Has not much to do IMFO with threads.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this