- public synchronized Rect getFramingRect() {
- if (framingRect == null) {
- if (camera == null) {
- return null;
- }
- Point screenResolution = configManager.getScreenResolution();
- if (screenResolution == null) {
- // Called early, before init even finished
- return null;
- }
-
- // int width = findDesiredDimensionInRange(screenResolution.x,
- // MIN_FRAME_WIDTH, MAX_FRAME_WIDTH);
- // int height = findDesiredDimensionInRange(screenResolution.y,
- // MIN_FRAME_HEIGHT, MAX_FRAME_HEIGHT);
-
- /* 扫描框修改 */
- DisplayMetrics metrics = context.getResources().getDisplayMetrics();
- int width = (int) (metrics.widthPixels * 0.6);
- int height = (int) (width * 0.9);
-
- int leftOffset = (screenResolution.x - width) / 2;
- int topOffset = (screenResolution.y - height) / 4;
- framingRect = new Rect(leftOffset, topOffset, leftOffset + width,
- topOffset + height);
- Log.d(TAG, "Calculated framing rect: " + framingRect);
- }
- return framingRect;
- }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)