I have a preview that is WpxHp, I want to take HxW pictures, thus I want the user to see a preview window that has the same aspect ratio of the picture I'll take, not the one of the preview. How can I crop the preview using the TextureView?
-- edit
what I thought is to use a scale Matrix to distort the image so as to cmpensate for the TextureView resize, let me explain better:
I have a target preview (image) size that is (W,H). Therefore I need to resize the TextureView to (W,H). This implies a distortion that simply is a non uniform linear scaling representable by the matrix S. Therefore if I scale the image with inv(S) before resizing the view I should obtain the same original dimensions of the Preview (thus the same aspect ratio) but with the TextureView resized and this is equivalent to a crop.
I tried and it seems to work, but I'm looking for an alternative way