Sep 2014
15 Mon
16 Tue
17 Wed 09:30 AM – 06:15 PM IST
18 Thu 08:30 AM – 06:00 PM IST
19 Fri 08:45 AM – 05:30 PM IST
20 Sat 08:45 AM – 05:15 PM IST
21 Sun
D.Vigneshwer
Using javascript to access Camera functions
This topic shows you the simplest way to capture a photo or video from your embedded or attached camera, by using the JS. This project will launche a full-screen dialog that presents a camera UI, and enables you to capture a photo or video with as little as one method call.
Objective: Capture a photo or video from a webcam.
simple description
Open an instance of Visual Studio.
2. Create a new project
In the New Project dialog box, choose a blank application from the JavaScript project types.
3. Insert the app JavaScript and HTML
Open your file Default.html and copy the following HTML into this file (replacing its original contents).
courtesy : msdn
but this is the best description i can give
<!DOCTYPE html>
<html>
<head>
<title>WinWebApp1</title>
<!-- WinJS references -->
<link rel=“stylesheet” href=“/winjs/css/ui-dark.css” />
<script src=“/winjs/js/base.js”></script>
<script src=“/winjs/js/wwaapp.js”></script>
<!-- WinWebApp1 references -->
<link rel=“stylesheet” href=“/css/default.css” />
<script type = “text/javascript” >
// Takes a photo using the default JPEG format.
function takepicture() {
var captureUI = new Windows.Media.Capture.CameraCaptureUI();
captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) {
if (capturedItem) {
document.getElementById(“message”).innerHTML = “User captured a photo.”
}
else {
document.getElementById(“message”).innerHTML = “User didn’t capture a photo.”
}
});
}
</script>
</head>
<body>
<input type=“button” onclick=“takepicture()” value=“Take a Picture” /><br />
<span id=“message”></span>
</body>
</html>
I am Vigneshwer Dhinakaran presently studying 3rd year in ECE at rajagiri college, ernakulam and also a founder of a startup company altroid. To be short and sweet I am an Innovative Engineer with an artistic perception of technology. I hold sun certified certificates on core java and J2EE .Have developed around 6 apps in various platforms ,and created around 10 websites. I have been as speaker and participant in various paper presentation competitons ,IEEE conferences ,pitching session at startup village and have taken workshops in web and app development for Rset ieee club .I am a active mozillian from mozilla kerala and have been involved in various mozilla activities & project contributions.
detailed session presentation will be drafted if selected.
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}