Problem with print Graphics using EPL Commands

Dec 14, 2014 at 4:56 PM
Can someone help me? I need an example to use Graphics EPLCommands. I try print on Zebra GX430t. I getting a empty label without a image. I want to print a image(monochrome bitmap) on the label with size: height equal 35 mm & width equal 156 mm. The Image must be on the all label. My printer has resolution 300DPI. This's my code:
            string PrinterName = "Zebra GX430t";
        string ImgPath = @"C:\image.bmp"; 
        Com.SharpZebra.Printing.PrinterSettings p = new Com.SharpZebra.Printing.PrinterSettings();
            p.PrinterName = PrinterName;
            p.Darkness = 30;
            p.Width = 1842;
            p.Length = 411;
            p.PrintSpeed = 10;

            List<byte> res = new List<byte>();

            res.AddRange(Com.SharpZebra.Commands.EPLCommands.ClearPrinter(p));
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.GraphicDelete("RLFSAM"));
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.ClearPrinter(p));
            MemoryStream myMemoryStream = new MemoryStream();

            Bitmap myImage = new Bitmap(ImgPath);
            myImage.Save(myMemoryStream, System.Drawing.Imaging.ImageFormat.Bmp);

            res.AddRange(Com.SharpZebra.Commands.EPLCommands.GraphicStore(myMemoryStream, "RLFSAM"));
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.PrintBuffer(1));
            new Com.SharpZebra.Printing.SpoolPrinter(p).Print(res.ToArray());

            System.Threading.Thread.Sleep(2000);

            res = new List<byte>();
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.ClearPrinter(p));
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.GraphicWrite(1, 1, "RLFSAM", p));
            res.AddRange(Com.SharpZebra.Commands.EPLCommands.PrintBuffer(1));
            new Com.SharpZebra.Printing.SpoolPrinter(p).Print(res.ToArray());

            System.Threading.Thread.Sleep(700);
When I print this image with Zebra Designer all is good.
Coordinator
Dec 15, 2014 at 12:57 AM
With EPL, you can only send a 1-bit monochrome PCX file to the printer for images.
See this thread:
https://sharpzebra.codeplex.com/discussions/221804

Is there a reason why you're not using ZPL? Your printer supports it.
Dec 15, 2014 at 7:21 AM
No, I can use ZPL. I try print an image with EPL, because I had some problems with ZPL. Furthermore, I tried to print the image with this code:
      string selectedPrinterName = "Zebra GX430t";
      string ImgPath = @"C:\image.bmp"; //monochrome bmp
      PrinterSettings settings = new PrinterSettings();
      settings.PrinterName = selectedPrinterName;
      settings.Width = 1842; //  convert from 156 mm & 300 DPI
      settings.Length = 411; //  convert from 35 mm & 300 DPI
      settings.PrintSpeed = 10;
      settings.Darkness = 30;

      List<byte> list1 = new List<byte>();
      list1.AddRange(ZPLCommands.ClearPrinter(settings));
      list1.AddRange(ZPLCommands.GraphicDelete('R', "RLFSAM"));
      list1.AddRange(ZPLCommands.ClearPrinter(settings));
      list1.AddRange(ZPLCommands.GraphicStore(new Bitmap(ImgPath), 'R', "RLFSAM"));
      list1.AddRange(ZPLCommands.PrintBuffer(1));
      new SpoolPrinter(settings).Print(list1.ToArray());

      Thread.Sleep(2000);

      List<byte> list2 = new List<byte>();
      list2.AddRange(ZPLCommands.ClearPrinter(settings));
      list2.AddRange(ZPLCommands.GraphicWrite(1, 1, "RLFSAM", 'R'));
      list2.AddRange(ZPLCommands.PrintBuffer(1));
      new SpoolPrinter(settings).Print(list2.ToArray());
but the result is the same negative. I getting an empty label without an image. My printer is connected throug LPT port. Have you any ideas?