Justin Gardner
Justin Gardner

Reputation: 625

Barbecue - Barcode background matching picture background

So I'm trying to get the background on the barcode to match the color on the image I'm trying to stick the barcode on. Here is an example to show you what I'm saying.

Example of off color

You see, most of my car is covered in that off-white color, while the bar code has a white background. Here is the code I am using to generate it.

Barcode barcode = BarcodeFactory.createCode128B(MemberId);
barcode.setDrawingText(true);
barcode.setBarHeight(100);
barcode.setBarWidth(3);
barcode.draw(g,1025, 480);

Any idea's on what I could do to get it to match?

Thanks -Rhyno

Upvotes: 0

Views: 894

Answers (1)

flup
flup

Reputation: 27104

Set the background of the barcode to the desired Color using barcode.setBackground(), as you can on any Component.

Upvotes: 2

Related Questions