mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
15 lines
402 B
Markdown
15 lines
402 B
Markdown
Sample usage:
|
|
```
|
|
var camera = require("camera");
|
|
|
|
camera.takePicture({"width": 300, "height": 300, "keepAspectRatio": true, "saveToGallery": true}).then(function (image) {
|
|
console.log('pic taken - width: ' + image.width + ", height: " + image.height);
|
|
}).fail(function (error) {
|
|
console.log('pic canceled');
|
|
});
|
|
|
|
if(camera.isAvailable()){
|
|
console.log('you may take a picture');
|
|
}
|
|
```
|