ViewfinderView.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:Zxing 作者:
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);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号