Android studio camera parameters -
i made camera app need add area on surfaceview camera capture part of hole surfaceview, qr code surface view when have squar area put qr code in camera. here code
private camerasource camerasource; private surfaceview cameraview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); cameraview = (surfaceview) findviewbyid(r.id.surface_view); textblockcontent = (textview) findviewbyid(r.id.text_value); camerasource = new camerasource.builder(getapplicationcontext(), textrecognizer) .setfacing(camerasource.camera_facing_back) .setrequestedpreviewsize(1280, 1024) .setrequestedfps(2.0f) .setautofocusenabled(true) .build(); cameraview.getholder().addcallback(new surfaceholder.callback() { @override public void surfacecreated(surfaceholder holder) { try { //noinspection missingpermission camerasource.start(cameraview.getholder()); } catch (ioexception ex) { ex.printstacktrace(); } } @override public void surfacechanged(surfaceholder holder, int format, int width, int height) { } @override public void surfacedestroyed(surfaceholder holder) { camerasource.stop(); } }); }
Comments
Post a Comment