How to capture image using camera without user interaction.

pmeshgpmeshg Member ✭✭

Hi

I am developing an application (Xamarin Forms) where I want to capture image without user interaction on camera.

Scenario :- On the form if user click on capture image button than I want to automatically capture image using camera and display on same page and save it on selected path. In this case user should not click manually on camera's capture button to take picture.

Is there any solution to achieve it?

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    There are several nuget packages for helping making the camera easier to interact with.
    As well as several tutorials on using the camera.

    What problems specifically have you run into in your current attempts? Sharing your code and the error messages help us, to help you.

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭

    I'm not sure that this is possible or practical. How is the user going to frame the image before tapping the button on your form? You need to display the camera preview so that the user can then 'take the picture' when the correct image is framed.

    Otherwise your app is going to have a lot of weird pictures of feet etc.!

    Or am I missing something...? :/

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Sounds like he is describing automatic frame and shutter like your banking app does when you electronically deposit a check.

    • You tap "take photo" button...
    • Camera UI comes up...
    • Shows frame around object and does edge detection...
    • When it detects a document (your check) it then refocuses and snaps the shutter.
      All the user does is hold it still and line up the shot.

    If that's not what he's talking about then I'm lost. Because this

    user click on capture image button than I want to automatically capture image using camera

    Doesn't make sense. If the user is tapping a capture button then where does the 'automatic' part come in - if its not similar to the workflow I described above.

  • pmeshgpmeshg Member ✭✭

    Hi

    Thanks for your replies

    You need to display the camera preview so that the user can then 'take the picture' when the correct image is framed.

    Yes I am showing camera preview in same form.

    I have developed android native application (not xamrin android). In my android application I have developed the functionality where I am capturing image without redirecting to camera app and without user interface. Basically I am capturing the images in my application using button not from camera button.

    I want to do same in xamrin Forms, Is there any way to achieve this?

    I have attached screenshots of my application
    Attachment – 1 (HomePage.png) :- Home page with camera preview and capture image button.
    Attachment – 2 (CameraCapture-1.png) :- After clicked on button I capture image and showing in thumbnail.
    Attachment – 3 (CameraCapture-2.png) :- Second image is captured using same button click.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    If you've already done it in Android native you should be able to migrate that to your Xamarin app, as the Android project's DependencyService implementation. I assume you wrote that in Java so you'll have to translate that to C#. It shouldn't be hard so much as just grunt translation of code from one language to another.

  • pmeshgpmeshg Member ✭✭

    @ClintStLaurent said:
    If you've already done it in Android native you should be able to migrate that to your Xamarin app, as the Android project's DependencyService implementation. I assume you wrote that in Java so you'll have to translate that to C#. It shouldn't be hard so much as just grunt translation of code from one language to another.

    My basic requirement is that application should work on all platform(Android, IOS and Windows). Currently I don't implemented such a functionality in the IOS and Windows, so I am looking for "Xamarin Forms" plugin (or code snippet) which is doing above functionality and which will work on all three platforms.

    Currently samples which are available on internet user external camera interface to take images, so these things are not working for me.

  • ohgabbeyohgabbey Member ✭✭

    Hi @pmeshg, my problem is quite similar with yours. Have you found a solution already? Please let me know. Thanks :blush:

Sign In or Register to comment.