Skip to content

Instantly share code, notes, and snippets.

@jiemachina
Last active December 11, 2015 17:08
Show Gist options
  • Save jiemachina/4631989 to your computer and use it in GitHub Desktop.
Save jiemachina/4631989 to your computer and use it in GitHub Desktop.
zxing 竖屏截图
public synchronized Rect getFramingRectInPreview(){
int tmpRigth = rect.right;
int tmpLeft = rect.left;
int tmpTop = rect.top;
int tmpBottom =rect.bottom;
rect.left = (tmpTop * cameraResolution.x) /screenResolution.y ;
rect.top = cameraResolution.y - tmpRigth *cameraResolution.y/screenResolution.x;
rect.right = tmpBottom * cameraResolution.x/screenResolution.y ;
rect.bottom = cameraResolution.y-tmpLeft*cameraResolution.y/screenResolution.x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment