Fire monkey help

I think I need reading material on using a fire monkey canvas
what I’m thinking is
I want to capture the android camera about 6 times a second into about 3 bit maps
I want to read pixels out of these bitmaps

Has anyone seen anything on this subject please

I believe there’s a camera example app for Android that comes with Delphi, as a starting point?

1 Like

There is one here: RADStudio12Demos/Object Pascal/Multi-Device Samples/Media/PhotoEditorDemo at main · Embarcadero/RADStudio12Demos · GitHub

6 times a second is not likely to be possible due to restrictions on the way Android hardware can be accessed.

Are you doing this because you are trying to do some sort of recognition app? If so you might want to explore the various computer vision libraries.

The Awesome Pascal list has a few links for them: GitHub - r3code/awesome-delphi: A curated list of awesome Delphi frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.

Open CV is the defacto standard.

Its a scanner project I have a bit like a QR scanner
I have written it in windows with Delphi 7
I can use a number of threads in the scan to get speed
what every one does is shake the camera when touching the screen
so I want a picture 0.2 of a second before pressing the screen and getting the shake
of course this is all trial and error stuff

I’m totally not familiar with a FIRE MONEY canvas as it does not have pixels statement
so what can I use

I’m not trying to replace a QR code or compete I have a totally different market and use

Maybe something in https://www.youtube.com/watch?v=EDgCyE0MSVo helps

I have being playing with this for a while now and the Demo is a good place to start but basically I think you use the device manager to get a TVideoCaptureDevice which I think you may be able to set the sample rate but by default the samples come at a rate for a tolerable video view in an image control. ie a few per second.

You set the OnSampleBuffer ready property and in that function use Dev.SampleBufferToBitMap passing in your image bitmap. The image then updates with each sample. There is nothing stopping you from getting a separate bitmap for each sample.

What is best is the demo app runs on a Windows 10 Laptop so you can develop without going to the phone. I have trouble with Windows 11 camera which I assume is a permissions issue and last time I looked the Demo did not address this.

From memory the demo does address permissions on the Android phone.

1 Like

hsvandrew
Thanks for the video from Alister Christie
as I said I see the data going into a buffer and that is so good
But fire monkey is going to be very different with a android phone that the code i expect will be very different.

RogerConnell I see you got miss lead by hsvandrew as your answer was very correct for windows but not android
you both gave me the basics that gives me something to now work on that I know I will get their as I have navigated Delphi like this before

Thanks

Sorry Lex

My application is basically for Android phones the comment on Windows 10/11 was promoting the cross platform functionality of Delphi FMX.
I find debugging logic on the phone to be tedious. The camera component and objects work cross platform with Delphi handling the different platform implementations under the hood.

The “Permissions” area is one that you need to customize for Android.

My code runs on both Windows and new and old Android phones with minor compiler conditionals.

{$IFDEF Android}
{$IFDEF ISD103R_DELPHI}
  PermissionsGranted([Camera, DataAcc], False, true, nil);
{$ENDIF}
{$ENDIF}

Yes I got the basic idea that I needed thanks
I’m running Delphi 11
I’m sure I can cut the Android camera frame rate down and hopefully get a good resolution some how as that’s my bit to get right.
Because I’m new to Delphi 11 I have heaps of stupid things to work out
Getting access to the project manager to get to FMX
I’m still have the reading of pixels from a bitmap as pixels have gone with android bitmaps
Just the stupid things jumping from Delphi 7 to Delphi 11
but I will get their as I chunk at it.

Thanks guys