User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

built_in:cameraview

This is an old revision of the document!


Table of Contents

CameraView control

Create

Create a camera preview control using the CreateCameraView function of the app object:

cam = app.CreateCameraView( width, height, options );

This control allows your program to show a live feed of what is currently being seen by the phone/tablet's camera. If your device has a front facing camera and is at least version 2.3 of Android you can use the “Front” option to show the front camera's preview.

You will need to call the StartPreview function of the CameraView control to start the preview (Note: On some phones it is neccessary to wait at least one second before calling the StartPreview function).

cam.StartPreview();

Methods

Method Description
CameraView.AutoCapture( p1,p2,p3 )
CameraView.Destroy()
CameraView.Focus()
CameraView.GetAbsHeight()
CameraView.GetAbsWidth()
CameraView.GetCameraCount()
CameraView.GetHeight()
CameraView.GetImageHeight()
CameraView.GetImageWidth()
CameraView.GetPictureSizes()
CameraView.GetPixelData( format,left,top,width,height )
CameraView.GetPosition()
CameraView.GetType()
CameraView.GetVisibility()
CameraView.GetWidth()
CameraView.MotionMosaic( p1,p2,p3,p4,p5 )
CameraView.Release()
CameraView.ReportColors( list,callback,sampSize,maxRate )
CameraView.SetBackColor( p1 )
CameraView.SetBackGradient( p1,p2,p3,p4,p5,p6,p7 )
CameraView.SetBackGradientRadial( p1,p2,p3,p4,p5,p6,p7 )
CameraView.SetBackground( p1,p2 )
CameraView.SetFlash( onoff )
CameraView.SetFocusMode( mode )
CameraView.SetMargins( left,top,right,bottom )
CameraView.SetOnMotion( callback )
CameraView.SetOnPicture( callback )
CameraView.SetOnReady( callback )
CameraView.SetPadding( p1,p2,p3,p4 )
CameraView.SetPictureSize( p1,p2 )
CameraView.SetPosition( p1,p2,p3,p4 )
CameraView.SetPreviewImage( p1 )
CameraView.SetScale( x,y )
CameraView.SetSize( p1,p2 )
CameraView.SetSound( onoff )
CameraView.SetVisibility( p1 )
CameraView.StartPreview()
CameraView.StopPreview()
CameraView.Stream( p1,p2,p3,p4,p5 )
CameraView.TakePicture( p1 )
built_in/cameraview.1417787136.txt.gz · Last modified: 2014/12/05 21:45 (external edit)