private void drawResultPoints(Bitmap barcode,float scaleFactor,Result rawResult){
  ResultPoint[] points=rawResult.getResultPoints();
  if (points != null && points.length > 0) {
    Canvas canvas=new Canvas(barcode);
    Paint paint=new Paint();
    paint.setColor(ContextCompat.getColor(this,R.color.result_points));
    if (points.length == 2) {
      paint.setStrokeWidth(4.0f);
      drawLine(canvas,paint,points[0],points[1],scaleFactor);
    }
 else     if (points.length == 4 && (rawResult.getBarcodeFormat() == BarcodeFormat.UPC_A || rawResult.getBarcodeFormat() == BarcodeFormat.EAN_13)) {
      drawLine(canvas,paint,points[0],points[1],scaleFactor);
      drawLine(canvas,paint,points[2],points[3],scaleFactor);
    }
 else {
      paint.setStrokeWidth(10.0f);
      for (      ResultPoint point : points) {
        if (point != null) {
          canvas.drawPoint(scaleFactor * point.getX(),scaleFactor * point.getY(),paint);
        }
      }
    }
  }
}

private void drawResultPoints ( Bitmap barcode , float scaleFactor , Result rawResult ) { ResultPoint [ ] points = rawResult . getResultPoints ( ) ; if ( points != null && points . length > 0 ) { Canvas canvas = new Canvas ( barcode ) ; Paint paint = new Paint ( ) ; paint . setColor ( ContextCompat . getColor ( this , R . color . result_points ) ) ; if ( points . length == 2 ) { paint . setStrokeWidth ( 4.0f ) ; drawLine ( canvas , paint , points [ 0 ] , points [ 1 ] , scaleFactor ) ; } else if ( points . length == 4 && ( rawResult . getBarcodeFormat ( ) == BarcodeFormat . UPC_A || rawResult . getBarcodeFormat ( ) == BarcodeFormat . EAN_13 ) ) { drawLine ( canvas , paint , points [ 0 ] , points [ 1 ] , scaleFactor ) ; drawLine ( canvas , paint , points [ 2 ] , points [ 3 ] , scaleFactor ) ; } else { paint . setStrokeWidth ( 10.0f ) ; for ( ResultPoint point : points ) { if ( point != null ) { canvas . drawPoint ( scaleFactor * point . getX ( ) , scaleFactor * point . getY ( ) , paint ) ; } } } } }
superimpose a line for 1d or dots for 2d to highlight the key features of the barcode .
