0

I have a fragment in which I'm using a TextureView, and I'm using the following link as a reference: https://github.com/googlesamples/android-Camera2Basic

Is there a way to modify the scope of the camera to take a "landscape" (it's not really a landscape, just a different scope) picture, even though I'm on portrait mode?

I'm attaching a photo of what I'm trying to achieve. I have a round white frame, I want to the scope of the camera/TextureView to be in that frame, and I want to add a button that takes exactly what's in that frame (with rounded corners). Is that possible?

enter image description here

Cookienator
  • 587
  • 5
  • 25

1 Answers1

0

It is feasible. You can use opengl to achieve it. First, draw camera frame to a external gl texture, then draw the frame in the gl texture to the screen. Crop the frame during the process of drawing to screen with modifying the texture coordinate and you will get your effect. the way is here: Crop video before encoding with MediaCodec for Grafika's "Continuous Capture" Activity

And the round corner effect can be also implement through modifying the texture coordinate. the way is here: How to make TextureView play video with round corners and bubble effect

dragonfly
  • 1,055
  • 12
  • 34