android - Video Camera Zoom -
i'm implementing android app record video. i'm trying implement zoom functionality i'm not able let work. haven't not found around code. post piece of code have tried. code inside oncreate method in main activity in i'm implementing video recording:
imageview test = (imageview) findviewbyid(r.id.zoom); test.setclickable(true); test.setonclicklistener(new onclicklistener() { public void onclick(view v) { context context4 = getapplicationcontext(); int duration = toast.length_short; camera.parameters parameters = mcamera.getparameters(); parameters.setzoom(parameters.getmaxzoom()); boolean zoom = parameters.iszoomsupported(); int maxzoom = parameters.getmaxzoom(); if (parameters.iszoomsupported()) { if (zoom >=0 && zoom < parameters.getmaxzoom()) { parameters.setzoom(parameters.getzoom()+1); parameters.setzoom(zoom); mcamera.setparameters(parameters); toast.maketext(context4, "zoom setted: "+parameters.getzoom(), duration).show(); } else { // zoom parameter incorrect toast.maketext(context4, "zoom not setted", duration).show(); } } } }); so have image view called "zoom" when clicked should increase zoom of video preview till reaching max zoom allowed!!! implement in theory nothing happen when click imageview....neither showing toast! i'm testing on nexus s. knows how modifiy code in order work or tried implement in different way? if yes how can do? ps: paramameter zoom defined above int initialized 1.
on nexus s case
!iszoomsupported() for example: https://code.google.com/p/aokp/issues/detail?id=172 .
this explain why not see toasts code inside
if (parameters.iszoomsupported()) {...}
Comments
Post a Comment