code: public java.awt.Image createAwtImage(Color foreground, Color background) {
          int f = foreground.getRGB();
          int g = background.getRGB();
          Canvas canvas = new Canvas();
  
          paintCode();
          int h = (int)yHeight;
          int pix[] = new int[bitColumns * codeRows * h];
          int stride = (bitColumns + 7) / 8;
          int ptr = 0;
          for (int k = 0; k < codeRows; ++k) {
              int p = k * stride;
              for (int j = 0; j < bitColumns; ++j) {
                  int b = outBits[p + (j / 8)] & 0xff;
                  b <<= j % 8;
                  pix[ptr++] = (b & 0x80) == 0 ? g : f;
              }
              for (int j = 1; j < h; ++j) {
                  System.arraycopy(pix, ptr - bitColumns, pix, ptr + bitColumns * (j - 1), bitColumns);
              }
              ptr += bitColumns * (h - 1);
          }
          
          java.awt.Image img = canvas.createImage(new MemoryImageSource(bitColumns, codeRows * h, pix, 0, bitColumns));
          return img;
      }
docs: Creates a <CODE>java.awt.Image</CODE>.
  @param foreground the color of the bars
  @param background the color of the background
  @return the image