Welcome to ARx API Docs
Interacting with the camera
Selecting camera input
1min
camera input selection isn't directly available via the api yet, however, in order to dynamically isolate your camera input into a bitmap, you can use the following function where previewwidth and previewheight depend on your current resolution, this means you must keep track of resolution changes //cameraresolution sd val previewwidth = 1280 val previewheight = 480 //cameraresolution md // val previewwidth = 2560 // val previewheight = 720 //cameraresolution hd // val previewwidth = 3840 // val previewheight = 1080 fun bytearraytocroppedbitmap(bytearray bytearray?) bitmap? { val yuvimage = yuvimage(bytearray, imageformat nv21, previewwidth, previewheight, null) val os = bytearrayoutputstream() yuvimage compresstojpeg(rect(0, 0, previewwidth, previewheight), 100, os) val jpegbytearray = os tobytearray() val bmp = bitmapfactory decodebytearray(jpegbytearray, 0, jpegbytearray size) return bitmap createbitmap(bmp, 0, 0, previewwidth / 2, previewheight) }