Результат квитанции Pirnt → Введите описание изображения здесь
Я хочу Recipt → Peticipt
qr iamage здесь → qrimage < /p>
Это Qrimage - растровый карта (128x128) < /p>
Я успешно реализовал изображение растрового изображения, используя изображение, используя растровое изображение, используя изображение GS V 0 в ESC/POS.
Однако я не могу распечатать изображение и текст растрового изображения и текст на той же строке, используя GS V 0.
Я обнаружил, что многие люди задавали тот же вопрос, что и я. →
link < /p>
Я создал его для определения приоритетов печати изображений растрового карты вместо текста. . < /p>
Раздел кода, который кажется подозрительным.
Код: Выделить всё
for (int row = 0; row < height; row += 8) {
pos = 0;
// [1] ESC "*"
// : ESC "*" m nL nH [data]
sendData[pos++] = 0x1B;
sendData[pos++] = '*';
sendData[pos++] = 0; // mode: 0 (8-dot single density)
sendData[pos++] = (BYTE)(width & 0xFF); // nL
sendData[pos++] = (BYTE)((width >> 8) & 0xFF); // nH
for (int col = 0; col < width; col++) {
BYTE c = 0;
for (int i = 0; i < 8; i++) {
int currentRow = row + i;
if (currentRow < height) {
int byteIndex = currentRow * m_bmpInfo.bmWidthBytes + (col / 8);
int bitIndex = col % 8;
BYTE pixelByte = m_buf[byteIndex];
if (pixelByte & (0x80 >> bitIndex)) {
c |= (1 GetBitmap(&m_bmpInfo);
if (m_bmpInfo.bmBitsPixel != 1)
return ERR_PRT_WRITE;
int x1 = m_bmpInfo.bmWidth;
int y = m_bmpInfo.bmHeight;
int x = m_bmpInfo.bmWidthBytes;
int h = x * y;
m_buf = (BYTE *)malloc(h);
w_buf = (BYTE *)malloc(h);
if (m_buf == NULL || w_buf == NULL) {
return FALSE;
}
memset(m_buf, 0x00, h);
memset(w_buf, 0x00, h);
int width = m_bmpInfo.bmWidth;
int height = m_bmpInfo.bmHeight;
int bytesPerLine = (width + 7) / 8;
int numSlices = (height + 7) / 8;
BYTE sendData[1024];
int pos = 0;
for (int row = 0; row < height; row += 8) {
pos = 0;
// [1] ESC "*"
// : ESC "*" m nL nH [data]
sendData[pos++] = 0x1B;
sendData[pos++] = '*';
sendData[pos++] = 0; // mode: 0 (8-dot single density)
sendData[pos++] = (BYTE)(width & 0xFF); // nL
sendData[pos++] = (BYTE)((width >> 8) & 0xFF); // nH
for (int col = 0; col < width; col++) {
BYTE c = 0;
for (int i = 0; i < 8; i++) {
int currentRow = row + i;
if (currentRow < height) {
int byteIndex = currentRow * m_bmpInfo.bmWidthBytes + (col / 8);
int bitIndex = col % 8;
BYTE pixelByte = m_buf[byteIndex];
if (pixelByte & (0x80 >> bitIndex)) {
c |= (1
Вопросы и ответы здесь довольно незрелые. Извините.
Подробнее здесь: [url]https://stackoverflow.com/questions/79416837/how-can-i-print-an-image-on-a-epson-printer-using-mfc[/url]