android - Square SurfaceView(aspect ratio of 1:1) for a custom camera implementation (Like Instagram) -


i working on app @ moment. client requires camera preview square. tried overriding onmeasure in surfaceview implementation , setting

@override protected void onmeasure(int widthmeasurespec, int heightmeasurespec) {     super.onmeasure(widthmeasurespec, heightmeasurespec);     setmeasureddimension(getmeasuredwidth(), getmeasuredwidth()); } 

this not work well, preview stretched or compressed. can guide me needs done 1:1 aspect ratio. have read getting supported preview sizes none of them in required 1:1 aspect ratio.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -