Reputation: 625
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.
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
Reputation: 27104
Set the background of the barcode to the desired Color
using barcode.setBackground()
, as you can on any Component.
Upvotes: 2