每 24 行没有白线,我无法打印我的位图。我需要打印一个图像,但是这个图像有每 24 行到位的白线。
爱普生打印机将图像打印为下一种格式。
>line 23 01010101000010001010
>line 24 00001000100000000110
>line 25 --------- white line ------------
怎么能删掉这条该死的白线?
Image size
width:400px
height:73px
while (offset < height)
{
//format ESC* Epson printer
String modIMG = new String(new byte[]{0x1B, 0x2A, 33, 0, 2});
img.append(modIMG);
for (int x = 0; x < width; ++x) {
for (int k = 0; k < 3; ++k) {
byte slice= 0;
for (int b = 0; b < 8; ++b) {
int y = (((offset / 8) + k) * 8) + b;
int i = (y * width) + x;
boolean v = false;
if (i < bitSet.length()) {
v = bitSet.get(i);}
slice |= (byte) ((v ? 1 : 0) << (7 - b));
}
img.slice(new String(new byte[] {slice}));
}
}
offset += 24;
img.append(new String(new String(new byte[]{0x1B,0x33,30}));
}