thekeviv / CameraFeed

Xamarin Forms Live Camera Feed Page Android Custom Renderer Implementation using Android Camera2 API
1 stars 1 forks source link

OnImageAvailable is called always. How to implement Capture on click #1

Closed pkvaranasi closed 1 year ago

pkvaranasi commented 1 year ago

Hi, Your implementation of Camera Feed is good. Am trying to make changes to my requirement, but finding difficult in fixing this.

I would like to have the OnImageAvailable is called only when tapping on the View. Added View.IOnTouchListener and invoked CaptureImage() method. But am unable to stop calling the OnImageAvailable continuously.

Is there a way that I can use both the Feed preview and invoke the OnImageAvailable() method only on an event?

thekeviv commented 1 year ago

Hey @pkvaranasi , I no longer maintain this repo and haven't done Xamarin Forms development in a while. I did a little bit of web searching. My understanding is that there's a newer recommended CameraX API in Android which has nice image capture methods which I think can be used for your use case. Their documentation states that Camera2 is a bit lower level and CameraX is a bit easier to work with. Give that a look and consider creating a binding around that.

Also, try looking for existing libraries which implement this. If you struggle finding it, try contacting David Ortinau or James Montemagno on twitter and they are very helpful.

Cheers and Good Luck!