android - Change default camera properties -
i want take picture application using
intent camera = new intent(mediastore.action_image_capture); startactivityforresult(camera, take_picture);
and send webserver. since webserver compresses 150x150 image of size not more 50 kb, don't need take 3264x2448 image of size ~ 2 mb because takes hell lot of time send transfer. want take minimum sized image.
so, there way ask camera specific sized image?
i tried using camera api , changing properties:
private camera mcamera; camera.size picturesize = getsmallestpicturesize(mcamera .getparameters()); if (picturesize != null) { mcamera.getparameters().setpicturesize(picturesize.width, picturesize.height); } private camera.size getsmallestpicturesize(camera.parameters parameters) { camera.size result = null; (camera.size size : parameters.getsupportedpicturesizes()) { if (result == null) { result = size; } else { int resultarea = result.width * result.height; int newarea = size.width * size.height; if (newarea < resultarea) { result = size; } } } return (result); }
the problem still larger images. that's not actual problem:
when use preview this, this
not allowing user rotate preview, zoom in/out etc..
is there way use actual camera preview custom parameters?
some camera starting take image in landscape mode in portait mode. can fixed @ sdk level, bit expensieve @ runtime, cpu, can done.
you need smaller size:
-at sdk level implement pipeline, shrink captured image 10-15% of original one, drain battery, can done. - @ ndk level have implement custom driver each supported camera...for custom driver implement custom software , fine.
Comments
Post a Comment