Android Development modified camera scan Two-dimensional code box high width

Source: Internet
Author: User

I use a ready-made online example, can be used directly, but aspect inappropriate, now the mainstream is the big screen phone, so need to change.

Locate the Cameramanager class and change the method below

 PublicRect Getframingrect () {Point screenresolution=configmanager.getscreenresolution (); if(Framingrect = =NULL) {      if(Camera = =NULL) {        return NULL; }      intwidth = screenresolution.x * 3/5;//if (Width < min_frame_width) {//width = min_frame_width;//} else if (Width > max_frame_width) {//width = max_frame_width;//      }      intHeight = screenresolution.y * 3/5;//if (height < min_frame_height) {//height = min_frame_height;//} else if (height > max_frame_height) {//height = max_frame_height;//      }        /*custom, with a wide height of one of the narrow squares for the side length*/width= (width>height?)height:width); Height= (widthwidth:height); intLeftOffset = (screenresolution.x-width)/2;//int topoffset = (screenresolution.y-height)/2;        intTopoffset = (screenresolution.y-height)/2-40;/*Custom, put on a little*/Framingrect=NewRect (LeftOffset, Topoffset, LeftOffset + width, Topoffset +height); LOG.D (TAG,"Calculated framing Rect:" +framingrect); }    returnFramingrect; }

Download Link: http://download.csdn.net/detail/feijian_/8275179

Android Development modified camera scan Two-dimensional code box high width

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.