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",BarCodeReadType.Code39Standard); int counter = 0; while(reader.read()) { System.out.println("BarCode Type: "+reader.getReadType()); System.out.println("BarCode CodeText: " + reader.getCodeText()); BarCodeRegion region = reader.getRegion(); if(region != null) { BufferedImage img = ImageIO.read(file); Graphics g = img.createGraphics(img); region.drawBarCodeEdges(g,new Pen(Color.getRed(),1f)); img.save(".\\edge_" + counter++ +".png"); region.fillBarCodeRegion(g,Brushes.Green); img.save(".\fill_" + counter + ".png"); } } reader.Close();
Constructor and Description |
---|
BarCodeRegion(com.aspose.ms.System.Drawing.Point[] polygon)
Initializes a new instance of the
BarCodeRegion class. |
Modifier and Type | Method and Description |
---|---|
void |
drawBarCodeEdges(java.awt.Graphics g,
java.awt.Color pen)
Draws the bar code edges.
|
void |
fillBarCodeRegion(java.awt.Graphics g,
java.awt.Color brush)
Fills the bar code region.
|
java.awt.Point[] |
getPoints()
Gets the points of the region.
|
public BarCodeRegion(com.aspose.ms.System.Drawing.Point[] polygon)
BarCodeRegion
class.polygon
- The polygon.public java.awt.Point[] getPoints()
Gets the points of the region.
public void drawBarCodeEdges(java.awt.Graphics g, java.awt.Color pen)
Draws the bar code edges.
g
- The graphics.pen
- Pen that determines the color, width, and style of the polygon.public void fillBarCodeRegion(java.awt.Graphics g, java.awt.Color brush)
Fills the bar code region.
g
- The graphics.brush
- The brush.