[Type] Camera

Part of library: phonegap::camera
Inherits from: mobl::Object

Get access to the phone's camera and photo album.

Static methods

takePicture(quality : Num = 50) : String

Lets the user take a picture with the camera and returns the picture as data URI string, which can be stored in the database or used with the image control. This method returns null if the taking of the picture failed.

Example:

var img = "default.png"
image(img)
button("Take picture", onclick={
  img = Camera.takePicture();
});

pickPictureFromLibrary(quality : Num = 50) : String

Lets the user pick a picture from their photo album and returns the picture as data URI string, which can be stored in the database or used with the image control. This method returns null if the taking of the picture failed.

Example:

var img = "default.png"
image(img)
button("Pick picture", onclick={
  img = Camera.pickPictureFromLibrary();
});
phonegap/camera/camera.txt · Last modified: 2020/06/17 07:54 by Zef Hemel