B4A Library CameraKit

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Apr 14, 2019.

  1. DonManfred

    DonManfred Expert Licensed User

    This is a wrap for this Github project.

    CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service that scales, and endless camera possibilities.

    With CameraKit you are able to effortlessly do the following:

    • Image and video capture seamlessly working with the same preview session.
    • Automatic system permission handling.
    • Automatic preview scaling.
      • Create a CameraView of any size (not just presets!).
      • Automatic output cropping to match your CameraView bounds.
    • Multiple capture methods.
      • METHOD_STANDARD: an image captured normally using the camera APIs.
      • METHOD_STILL: a freeze frame of the CameraView preview (similar to SnapChat and Instagram) for devices with slower cameras.
      • METHOD_SPEED: automatic capture method determination based on measured speed.
    • Built-in continuous focus.
    • Built-in tap to focus.
    • Built-in pinch to zoom. Even while recoding a Video.

    CameraKit
    <link>...|http://www.b4x.com</link>
    Author: DonManfred
    Version: 0.52
    • CameraKit
      • Events:
        • onError (error As String)
        • onEvent (event As String)
        • onImage (image() As Byte)
        • onTextDetect (detectedText As String)
        • onVideo (video As String)
      • Functions:
        • addController (controller As com.wonderkiln.camerakit.CameraKitController)
        • bindCameraKitListener (object As Object)
        • BringToFront
        • captureImage
        • captureImage2
        • captureVideo (path As String, filename As String)
          Starts capturing a Video. The Video is saved
          to the given path using the given filename
          The duration is set to endless. You need to stop
          the capture using stopVideo().
        • captureVideo2 (path As String, filename As String, maxDuration As Int)
          Starts capturing a Video. The Video is saved
          to the given path using the given filename
          The maximum duration is set to maxDuration seconds.
        • DesignerCreateView (base As Panel, lw As Label, props As Map)
        • Initialize (EventName As String)
        • Invalidate
        • Invalidate2 (arg0 As android.graphics.Rect)
        • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
        • isFacingBack As Boolean
        • isFacingFront As Boolean
        • IsInitialized As Boolean
        • isStarted As Boolean
        • RemoveView
        • RequestFocus As Boolean
        • SendToBack
        • SetBackgroundImage (arg0 As android.graphics.Bitmap) As BitmapDrawable
        • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
        • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
        • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
        • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
        • start
        • stop
        • stopVideo
        • toggleFacing As Int
        • toggleFlash As Int
      • Properties:
        • Background As android.graphics.drawable.Drawable
        • CameraProperties As com.wonderkiln.camerakit.CameraProperties [read only]
        • CaptureSize As com.wonderkiln.camerakit.Size [read only]
        • Color As Int [write only]
        • CropOutput As Boolean [write only]
        • Enabled As Boolean
        • Facing As Int
        • Flash As Int
          0 = FLASH_OFF,
          1 = FLASH_ON,
          2 = FLASH_AUTO,
          3 = FLASH_TORCH
        • Focus As Int [write only]
          0 = FOCUS_CONTINUOUS,
          1 = FOCUS_TAP,
          2 = FOCUS_OFF,
          3 = FOCUS_TAP_WITH_MARKER
        • Height As Int
        • JpegQuality As Int [write only]
        • Left As Int
        • LockVideoAspectRatio As Boolean [write only]
        • Method As Int [write only]
          0 = METHOD_STANDARD, 1 = METHOD_STILL
        • Padding As Int()
        • Parent As Object [read only]
        • PinchToZoom As Boolean [write only]
        • PreviewSize As com.wonderkiln.camerakit.Size [read only]
        • Tag As Object
        • Top As Int
        • VideoBitRate As Int [write only]
        • VideoQuality As Int [write only]
          0 = VIDEO_QUALITY_QVGA, 1 = VIDEO_QUALITY_480P,
          2 = VIDEO_QUALITY_720P, 3 = VIDEO_QUALITY_1080P,
          4 = VIDEO_QUALITY_2160P,5 = VIDEO_QUALITY_HIGHEST,
          6 = VIDEO_QUALITY_LOWEST
        • Visible As Boolean
        • Width As Int
        • Zoom As Float [write only]

    Known issues:
    It depends on Google Playservice Vision but the Textrecognition seems to freeze the app. So for now i´ve removed the ability to activate it but the reference must still be there.


    Setup:

    Download
    CameraKit1.zip and rename it to CameraKit.zip.001
    CameraKit2.zip and rename it to CameraKit.zip.002

    Extract it with 7Zip.
     

    Attached Files:

  2. DaniDPX

    DaniDPX Member Licensed User

  3. Peter Simpson

    Peter Simpson Expert Licensed User

    I'm going to have a play with this library later on today, cheers Don :cool:
     
  4. johndb

    johndb Active Member Licensed User

    Thank you very much for this library @DonManfred. I'd like to test it but am having difficulty unzipping your split zip using 7zip. Any chance of you uploading a standard zip (one archive) with all the library files? Thanks.
     
  5. DonManfred

    DonManfred Expert Licensed User

  6. JanG

    JanG Member Licensed User

    Thanks!

    Compiling: OK
    Installation: OK
    Running: Crash while starting. No GUI. Nothing. Just crash...

    Device: Samsung A40, Android 9

    Any ideas?
     
  7. DonManfred

    DonManfred Expert Licensed User

    - You should always create a new thread in the questionsforum for any issue you have.
    - You need to provide more informations in that thread. Post the full error. There is no such thing in android like Crash while starting. No GUI. Nothing. There is always a error in the Log. Maybe you need to check the unfiltered log but the error must be there.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice