Take a photo on the web with Windows 8.1 tablet

5

What I need

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

What I've tried

I've already tried using HTML5 to do this:

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

But from what I've tried and tested here on tablet , these tags only work on iOs and Android.

I found one of BridgeIt , but it was not compatible, I also found a article on the subject, I copied the tutorial code but neither on the computer worked.

    
asked by anonymous 22.01.2015 / 14:28

3 answers

1

1 - Have you tried through an XHR request inside the 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 - See this topic: link

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 such as camera, video camera and audio.

I think this tag definitely will not work on iOS5.

4 - Documentation: link

Source:

link

    
25.01.2015 / 03:32
1

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

Currently much is discussed and promoted about HTML5 and since you are using Win 8.1, your browser will probably have support for it.

Try the material from this link:

link

Remember that WinRT 8.1 is different from Win 8.1, so browser support may 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 quirks, check your browser's support for html5.

    
22.01.2015 / 14:43
0

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

This example shows how to capture video, record audio, take a picture, and more. To capture images, you used the LowLagPhotoCapture and LowLagPhotoControl .

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

To access the preview of captured photos you can use CapturePhoto.Thumbnail and PhotoCapturedEventArgs.Thumbnail .

Microsoft article that can help:

25.01.2015 / 02:27