public final class BarCodeRegion extends Object
Represents the barcode's region
Draw edges of the barcode region, then fill it.[Java] 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) { com.aspose.ms.System.Drawing.Image img = com.aspose.ms.System.Drawing.Image.fromFile(file); com.aspose.ms.System.Drawing.Graphics g = com.aspose.ms.System.Drawing.Graphics.fromImage(img); com.aspose.ms.System.Drawing.Pen pen = new com.aspose.ms.System.Drawing.Pen(Color.getRed(), 1f); region.drawBarCodeEdges(Graphics.toJava(g), pen, pen.getBrush()); img.save(StringExtensions.format(".\\edge_{0}.png", counter++)); region.fillBarCodeRegion(Graphics.toJava(g), com.aspose.ms.System.Drawing.Brushes.getGreen()); img.save(StringExtensions.format(".\\fill_{0}.png", counter++)); } } reader.close();
Modifier and Type | Method and Description |
---|---|
void |
drawBarCodeEdges(Graphics2D g,
Stroke pen,
Paint brush)
Draws the bar code edges.
|
void |
fillBarCodeRegion(Graphics2D g,
Paint brush)
Fills the bar code region.
|
Point[] |
getPoints() |
public Point[] getPoints()
public void drawBarCodeEdges(Graphics2D g, Stroke pen, Paint brush)
Draws the bar code edges.
g
- The graphics.pen
- Pen that determines the color, width, and style of the polygon.public void fillBarCodeRegion(Graphics2D g, Paint brush)
Fills the bar code region.
g
- The graphics.brush
- The brush.Copyright (c) 2002-2014 Aspose Pty Ltd. All Rights Reserved.