I would like to effectively make a simple digital zoom for the camera preview, so I thought I would simply resize my SurfaceView to be larger than the screen. Other questio
Here's my TouchSurfaceView
's onMeasure
that performs zoom:
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension((int) (width * scaleFactor), (int) (height * scaleFactor));
}
This properly zooms in and out depending on scaleFactor.
I haven't tested this with camera, but it works properly with MediaPlayer
(behaving as VideoView
).