I have a preview, which is WpxHp, I want to take HxW pictures, so I want the user to see a preview window that has the same aspect ratio of the image that I take, and not one from the preview. How to crop a preview using TextureView?
- edit
what i thought was to use the scale matrix to distort the image so that cmpensate to resize the TextureView, let me explain better:
I have a target preview (image) whose size is (W, H). So I need to resize the TextureView to (W, H). This means distortion, which simply represents the uneven linear scaling represented by the matrix S. Therefore, if I scale the image with inv (S), before I resize the view, I have to get the same original Preview sizes (with the same aspect ratio) but with resizing TextureView, and this is equivalent to cropping. I tried and it seems to work, but I'm looking for an alternative way.
source
share