CameraView

class CameraView()

CreateCameraView()

Также имеет следующие методы:

AutoCapture(folder, fileName, maxCount)
Destroy()
FindFaces(maxFaces)
Focus()
GetAbsHeight()
GetAbsWidth()
GetCameraCount()
GetColorEffects()
GetImageHeight()
GetImageWidth()
GetMaxZoom()
GetParameters()
GetPictureSizes()
GetPixelData(format, left, top, width, height)

format can be “rawbase64”, “pngbase64” or “jpgbase64”

GetPosition()
GetType()
GetZoom()
IsRecording()
MotionMosaic(xtiles, ytiles, sensitivity, minPeriod, imageObj)
Record(fileName, seconds);()
Release()
ReportColors(list, callback, sampSize, maxRate)
cam.ReportColors('0.5,0.5', OnColor, 16, 300);

function OnColor(colors){
    color = colors[0]
    /*
     * red = color[0]
     * green = color[1]
     * blue = colors[2]
     */
}
SetBackGradient(color1, color2, color3, p4, p5, p6, p7)
SetBackGradientRadial(x, y, r, color1, color2, color3, p7)
SetBackground(imagefile, options)
SetColorEffect(effect)

use in SetOnReady

SetDuplicateImage(img1, img2)
SetFlash(onoff)
SetFocusMode(mode)
  • mode

    • Video
SetOnFocus(callback)
SetOnMotion(callback)
cam.SetOnMotion(function(data){});
SetOnPicture(callback)
SetOnReady(callback)
SetPadding(...)
SetParameter(name, value)
SetPictureSize(width, height)
SetPosition(...)
SetPreviewImage(imageObj)
SetScale(x, y)
SetSound(onoff)
SetZoom(level)
StartPreview()
Stop()
StopPreview()
Stream(ip, port, quality, fps, mtu)
TakePicture(fileName)