ich eine Lösung gefunden, hoffen, dass die Hilfe einer anderen Person, Dank an alle
den Barcode erstellen itext mit:
Barcode39 barcode = new Barcode39();
barcode.setCode("7001390283546141");
barcode.setBarHeight(40);
Image img = barcode.createAwtImage(Color.BLACK, Color.WHITE);
BufferedImage outImage = new BufferedImage(img.getWidth(null), img.getHeight(null),BufferedImage.TYPE_INT_RGB);
outImage.getGraphics().drawImage(img, 0, 0, null);
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
ImageIO.write(outImage, "png", bytesOut);
bytesOut.flush();
byte[] pngImageData = bytesOut.toByteArray();
FileOutputStream fos = new FileOutputStream("C:/results/barcode.jpg");
fos.write(pngImageData);
fos.flush();
fos.close();
den Barcode Bild
final BufferedImage image1 = ImageIO.read(new File("C:/results/image.jpg"));
final BufferedImage image2 = ImageIO.read(new File("C:/results/barcode.jpg"));
Graphics g = image2.getGraphics();
g.drawImage(image2, 0, 0, image2.getWidth(), image2.getHeight(), null);
g.dispose();
final int xMax = image1.getWidth() - image2.getWidth();
final int yMax = image1.getHeight() - image2.getHeight();
Graphics g2 = image1.getGraphics();
Random random = new Random();
int x = random.nextInt(xMax);
int y = random.nextInt(yMax);
g2.drawImage(image2, x, y, null);
g2.dispose();
File outputfile = new File("C:/results/final.jpg");
ImageIO.write(image1, "png", outputfile);
Jeder Code, der Sie nach erstellen habe versucht? – DarkV1
Ich verstehe den Punkt nicht gut ... Sie müssen einen Barcode generieren und speichern Sie es dann als Bild über ein anderes Bild, das Sie bereits haben ????? –
Mögliches Duplikat von [Android Erzeuge QR-Code und Barcode mit Zxing] (http://stackoverflow.com/questions/22371626/android-generate-qr-code-and-barcode-using-zxing) –