Zoom Camera2 Preview using TextureView

后端 未结 5 1955
清歌不尽
清歌不尽 2020-12-03 03:45

i have a Problem with my Preview Zoom for the Camera2 API. I am using a TextureView.

I want to zoom only the preview Stream that was showed in the TextureView.

5条回答
  •  猫巷女王i
    2020-12-03 04:45

    @arin Answer is working thank @arin just one thing zoom sensitivity too high.

    To control this i make some changes in might be useful to you.

    Change zoom_level data type to double

    public int zoom_level = 1; to public double zoom_level = 1;

    Then increase or decrease zoom_level with low value i use 0.4

    if (current_finger_spacing > finger_spacing && maxzoom > zoom_level) {
            zoom_level = zoom_level + .4;
            //zoom_level++;
        } else if (current_finger_spacing < finger_spacing && zoom_level > 1) {
            zoom_level = zoom_level - .4;
            //zoom_level--;
          }
    

提交回复
热议问题