title: how to print images with ESC/POS commands?
body: <p>i have an Epson-TMH6000III thermal printer and i want to print some bitmap with it by using ESC/POS commands.</p>
  
  <p>but before this i want to print a very simple single line with ESC/POS printing image commands.</p>
  
  <p>here's my attempt :</p>
  
  <pre><code>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 &amp; 0x0000ff00) &gt;&gt; 8;
              int lsb = (int)(bmp.Width &amp; 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 &lt; 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,
      }
  }
  </code></pre>
  
  <p>i didn't get the result. i appreciate for any help in this.</p>