QR code scan Android zxing picture stretching solution
Zxing is a QR code scanning project provided by Google
By default, the picture appears stretched after the horizontal screen is converted to a vertical screen.
Here are the workarounds:
Zxing Modify the Cameraconfigurationmanager.java file
void Initfromcameraparameters (Camera camera) method
In Log.d (TAG, "screen resolution:" + screenresolution);
Point Screenresolutionforcamera = new Point (); screenresolutionforcamera.x = screenresolution.x; SCREENRESOLUTIONFORCAMERA.Y = SCREENRESOLUTION.Y; Preview size is all something like 480*320, and other 320*480 if (screenresolution.x < SCREENRESOLUTION.Y) { screenresolutionforcamera.x = SCREENRESOLUTION.Y; SCREENRESOLUTIONFORCAMERA.Y = screenresolution.x; }
After putting the
Cameraresolution = getcameraresolution (parameters, screenresolution);
Changed to Screenresolutionforcamera in Screenresolution
As follows:
Cameraresolution = getcameraresolution (parameters, Screenresolutionforcamera);
Please leave a message below thank you
Want to be useful to you
Resources : http://download.csdn.net/detail/aaawqqq/7281577