Photo on the web with Windows 8.1 tablet

Asked

Viewed 141 times

5

What I need

I want to make a page where the user can click a button, take a picture with the camera of tablet, view it and click on button to save it.

What I’ve already tried

I have tried to use the HTML5 for that reason:

<input type="file" accept="image/*;capture=camera">

but for what I searched and tested here in the tablet, these tags only work on Ios and Android.

I found a certain Bridgeit, but it was not compatible, I also found a article on the subject, I copied the tutorial code but not even on the computer.

  • You tried the tips of that other question? Another thing: what is the biggest scope of your project? I ask this because if there are other interactions with the use and physical recognition of the tablet as a medium, it would probably be justified to create a native application instead of using a web page.

3 answers

1


1 - You tried through an XHR request inside onchange handler of the input file?

<input id="myFileInput" type="file" accept="image/*;capture=camera">

var myInput = document.getElementById('myFileInput');

function sendPic() {
    var file = myInput.files[0];

    // Send file here either by adding it to a `FormData` object 
    // and sending that via XHR, or by simply passing the file into 
    // the `send` method of an XHR instance.
}

myInput.addEventListener('change', sendPic, false);

2 - Look at this Tuto: http://www.html5rocks.com/en/tutorials/getusermedia/intro/


3 - On iPhone iOS6 and Android ICS onwards, HTML5 has the following tag that allows you to take photos from your device:

<input type="file" accept="image/*" capture="camera">

capture can assume values like camera, video camera and audio.

I think this tag will definitely not work on iOS5.

4 - Documentation: http://www.w3.org/TR/html-media-capture/#example-1

Source:

https://stackoverflow.com/questions/8581081/how-to-access-a-mobiles-camera-from-a-web-app

  • Worked?.....

1

There is still no guaranteed way to make it happen in all situations because of the different Browsers scenarios and environment settings you can find. The most correct is to choose some more specific scenarios that you intend to meet with your encoding and will probably depend more on the browser version that you intend to approve for your application than the OS.

Currently a lot is discussed and promoted about HTML5 and how you are using Win 8.1, probably your browser will support it.

Try the material of this link:

http://www.html5rocks.com/en/tutorials/getusermedia/intro/

Remember that Winrt 8.1 is different from Win 8.1, so browser support can vary from the system version and how up-to-date it is, the focus is on the browser and its settings. IE is famous for its particularities, check your browser support for Html5.

0

You can use the API MediaCapture to capture an image, video and audio. Here have an example of use made available by Microsoft for C++, C#, VB. NET and Javascript.

This example shows how to capture video, record audio, take a photo, and more. The classes were used to capture images LowLagPhotoCapture and LowLagPhotoControl.

It is also shown how to capture a sequence of photos using the classes LowLagPhotoSequenceCapture and LowLagPhotoSequenceControl.

To access the preview of the captured photos can be used CapturePhoto.Thumbnail and PhotoCapturedEventArgs.Thumbnail.

Microsoft article that can help:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.