@Deprecated
public final class BarCodeRegion
extends java.lang.Object
Represents the barcode's region.
Draw edges of the barcode region, then fill it.BarCodeReader reader; reader = new BarCodeReader("c:\\test.jpg", DecodeType.CODE_39_STANDARD); int counter = 0; while(reader.read()) { System.out.println("BarCode Type: " + reader.getCodeType()); System.out.println("BarCode CodeText: " + reader.getCodeText()); BarCodeRegion region = reader.getRegion(); if(region != null) { Bitmap img = BitmapFactory.decodeFile(file); Canvas g = new Canvas(img); region.drawBarCodeEdges(g, Color.RED); OutputStream out = new FileOutputStream(new File(".\\edge_" + counter++ +".png")); img.compress(Bitmap.CompressFormat.PNG, 100, out); region.fillBarCodeRegion(g, Color.GREEN); out = new FileOutputStream(new File(".\fill_" + counter + ".png")); img.compress(Bitmap.CompressFormat.PNG, 100, out); } } reader.close();
Modifier and Type | Method and Description |
---|---|
void |
drawBarCodeEdges(Canvas g,
int pen)
Deprecated.
Draws the bar code edges.
|
void |
fillBarCodeRegion(Canvas g,
int brush)
Deprecated.
Fills the bar code region.
|
android.graphics.Point[] |
getPoints()
Deprecated.
Gets the points of the region.
|
public android.graphics.Point[] getPoints()
Gets the points of the region.
public void drawBarCodeEdges(Canvas g, int pen)
Draws the bar code edges.
g
- The graphics.pen
- Pen that determines the color, width, and style of the polygon.public void fillBarCodeRegion(Canvas g, int brush)
Fills the bar code region.
g
- The graphics.brush
- The brush.