Content:
- Properties
- Methods

CameraViews are used to access the device camera.

cam = app.CreateCameraView( width=-1, height=-1, options? ) → app object: CameraView

You can use the “Front” option to show the front camera instead of the default back camera.

The camera needs some time to initialize first.
You can define a callback function via SetOnReady which is called if the camera can be used.
There you have to to call the StartPreview function of the CameraView control to start the preview.

Example - Show Camera Preview click to expand contents 

The basic functionality of the camera control is taking pictures or recording video.

Example - Take pictures click to expand contents 

Example - Record Video click to expand contents 

But it provides advanced image processing functions as well. These are color reporting, motion detection and face recognision.

Example - Motion Detector click to expand contents 

More samples can be found in the samples section of DroidScript.

Properties

The following properties are available on the CameraView object:

dataObject: { key, value }

Methods

The following methods are available on the CameraView object:

Focus()
GetAbsHeight() → Number: integer
GetAbsWidth() → Number: integer
GetCameraCount() → Number: integer
GetColorEffects() → String: “none”, “mono”, “negative”, “solarize”, “sepia”, “posterize”, “whiteboard”, “blackboard”, “aqua”, “vage-cold”, “point-blue”, “point-red-yellow”, “emboss”, “sketch”, “neon”
GetHeight( options? ) → Number
GetImageHeight() → Number: fraction (0..1)
GetImageWidth() → Number: fraction (0..1)
GetLeft( options? ) → Number
GetMaxZoom() → Number
GetParameters() → String: semicolon “;” separated: “key1=value1;key2=value2;...”
GetParent() → app object
GetPictureSizes() → String: comma “,” separated: “w1 x h1,w2 x h2,...”
GetPixelData( format, left, top, width, height ) → String: base64 encoded
GetPosition( options? ) → Object: { left, top, width, height }
GetTop( options? ) → Number
GetType() → String: “CameraView”
GetVisibility() → String: “Show” or “Hide” or “Gone”
GetWidth( options? ) → Number
GetZoom() → Number
Gone()
HasFlash() → Boolean
Hide()
IsEnabled() → Boolean
IsOverlap( obj, depth? ) → Boolean
IsRecording() → Boolean
IsVisible() → Boolean
Method( name, types?, p1?, p2?, p3?, p4? ) → all types
Resize()
SetScale( x, y )
Show()
Stop()