public final class BarCodeRegion extends 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(string.Format(@".\edge_{0}.png" ,counter++)); region.FillBarCodeRegion(g,Brushes.Green); img.Save(string.Format(@".\fill_{0}.png", counter++)); } } reader.Close();
Modifier and Type | Method and Description |
---|---|
void |
drawBarCodeEdges(Graphics g,
Color pen)
Draws the bar code edges.
|
void |
drawBarCodeEdgesInternal(com.aspose.ms.System.Drawing.Graphics g,
com.aspose.ms.System.Drawing.Pen pen) |
void |
fillBarCodeRegion(Graphics g,
Color brush)
Fills the bar code region.
|
void |
fillBarCodeRegionInternal(com.aspose.ms.System.Drawing.Graphics g,
com.aspose.ms.System.Drawing.Brush brush)
Fills the bar code region.
|
Point[] |
getPoints()
Gets the points of the region.
|
public Point[] getPoints()
Gets the points of the region.
public void drawBarCodeEdges(Graphics g, Color pen)
Draws the bar code edges.
g
- The graphics.pen
- Pen that determines the color, width, and style of the polygon.public void drawBarCodeEdgesInternal(com.aspose.ms.System.Drawing.Graphics g, com.aspose.ms.System.Drawing.Pen pen)
public void fillBarCodeRegionInternal(com.aspose.ms.System.Drawing.Graphics g, com.aspose.ms.System.Drawing.Brush brush)
Fills the bar code region.
g
- The graphics.brush
- The brush.Copyright (c) 2002-2015 Aspose Pty Ltd. All Rights Reserved.