ido435
Gebruiker
- Lid geworden
- 10 nov 2010
- Berichten
- 674
Goedendag,
ik ben nu al een tijde (1 1/2) dag bezig met een plugin voor Cordova / PhoneGap Camera plguin zie de 2 linkjes hier onder.
https://www.npmjs.com/package/cordova-plugin-camera#module_camera.getPicture
https://github.com/apache/cordova-plugin-camera#module_Camera.DestinationType
De bijbehordende plugins zijn geïnstalleerd.
Deze code heb ik nu zelf
b.v.d
Ido
Info terzijde:
Deze plugin werkt alleen vanaf android 4.0.× en hoger
Zelf werk ik met 3 devices met android 4.4.× , 4.3.× en 4.1.×
ik ben nu al een tijde (1 1/2) dag bezig met een plugin voor Cordova / PhoneGap Camera plguin zie de 2 linkjes hier onder.
https://www.npmjs.com/package/cordova-plugin-camera#module_camera.getPicture
https://github.com/apache/cordova-plugin-camera#module_Camera.DestinationType
De bijbehordende plugins zijn geïnstalleerd.
Deze code heb ik nu zelf
Code:
<html>
<head>
<meta charset="utf-8"/>
<meta name="format-detection" content="telephone=no" />
<script type="text/javascript" src="cordova.js"></script>
<script href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"
<meta name="viewport" content="user=scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=devicee-width, height=device-height, target-desitydpi=device-dpi" />
<style>
#myImage
{
max-width:100%;
}
#CameraButton
{
width: 6em;
height: 6em;
}
</style>
<meta name="msapplication-tap-highlight" content="no" />
</head>
<body>
<h1>Appache Cordova </h1>
<img src="" id="myImage">
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
$(function()
{ //$(document).ready(function(){}):
function cameraSuccess(imgdata)
{
$("#img_camPH").attr("src", imgData);
}
function camError(error)
{
alert(error);
}
function accessCamera()
{
var options = {
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.CAMERA //PHOTOGALLERY
};
navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
}
$("btn_camera").on("click", accessCamera);
});
</script>
<div data-role="page">
<div data-role="header">
<h1>Camera App</h1>
</div>
<div class="ui-content">
<button id="btn_camera"> Camera </button>
<img id="img_camPH">
</div>
</div>
</body>
</html>
b.v.d
Ido
Info terzijde:
Deze plugin werkt alleen vanaf android 4.0.× en hoger
Zelf werk ik met 3 devices met android 4.4.× , 4.3.× en 4.1.×
Laatst bewerkt: