Ich habe einen Epson-TMH6000III Thermodrucker, und ich möchte einige Bitmap mit ESC/POS-Befehle drucken.Wie drucke ich Bilder mit ESC/POS Befehlen?
aber vorher möchte ich eine sehr einfache einzelne Zeile mit ESC/POS-Druckbildbefehle drucken.
hier ist mein Versuch:
namespace printingImageMode
{
class Program
{
static void Main(string[] args)
{
Bitmap bmp = new Bitmap(@"C:\Users\falamarzi\Desktop\Kyan Graphic Viewer\jTest.jpg");
int msb = (int)(bmp.Width & 0x0000ff00) >> 8;
int lsb = (int)(bmp.Width & 0x000000ff);
byte msbB = Convert.ToByte(msb);
byte lsbB = Convert.ToByte(lsb);
byte[] enter_To_Image_Printing_Mode_Command = new byte[] { (byte)AsciiControlChars.ESC, (byte)DensityCommand.EightDot_SD, msbB, lsbB };
byte[] imageData = new byte[lsb + msb * 256];
for (int i = 0; i < imageData.Length; i++)
{
imageData[i] = 0xff;
}
byte[] complete_Command = new byte[enter_To_Image_Printing_Mode_Command.Length + imageData.Length];
enter_To_Image_Printing_Mode_Command.CopyTo(complete_Command, 0);
imageData.CopyTo(complete_Command, enter_To_Image_Printing_Mode_Command.Length);
SerialPort sPort = new SerialPort("COM5");
sPort.Open();
sPort.Write(complete_Command, 0, complete_Command.Length);
}
}
public enum AsciiControlChars : byte
{
ESC = 0x1b,
}
public enum DensityCommand : byte
{
EightDot_SD = 0x00,
EightDot_DD = 0x01,
TwentyFourDot_SD = 0x20,
TwentyFourDot_DD = 0x21,
}
}
ich nicht das Ergebnis bekommen haben. Ich schätze für jede Hilfe in diesem.