android - Camera preview on small surfaceView not showing the whole camera output -


my app showing camera preview on 1 of activities. show camera preview not taking full screen, inside small box.

the problem right image camera smaller want. example, when open can see there eyes , nose, see whole face.

it's surfeceview acting window in house allows me see part of views outside. idea in surfaceview (that not take whole screen space) whole camera output resized in order fit surfaceview.

is problem camera preview size? or should somehow resize camera output?

thanks in advance

you should give code find problem, @ least layout.xml file , class uses surfaceview , surfaceholder.callbacks. now, can try following if didn't.

in onsurfacechanged method use 2 int parameters width , height calculate best size preview. setpreviewsize , getsupportedpreviewsize.

if can't fix issue in easy way can try use imageview or textureview , paint on them image given onpreviewframe callback.


Comments