public ViewfinderView(Context context, AttributeSet attrs) {
super(context, attrs);
// Initialize these once for performance rather than calling them every
// time in onDraw().
paint = new Paint();
Resources resources = getResources();
maskColor = resources.getColor(R.color.viewfinder_mask);
resultColor = resources.getColor(R.color.result_view);
resultPointColor = resources.getColor(R.color.possible_result_points);
possibleResultPoints = new HashSet<ResultPoint>(5);
path = new Path();
lineRect = new Rect();
/**
* 获取屏幕密度
*/
density = context.getResources().getDisplayMetrics().density;
ScreenRate = (int) (20 * density);
}
ViewfinderView.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:Zxing
作者:
评论列表
文章目录