This project is read-only.

Problem with print Graphics using EPL Commands

Dec 14, 2014 at 5: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>();

            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"));
            new Com.SharpZebra.Printing.SpoolPrinter(p).Print(res.ToArray());


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

When I print this image with Zebra Designer all is good.
Dec 15, 2014 at 1:57 AM
With EPL, you can only send a 1-bit monochrome PCX file to the printer for images.
See this thread:

Is there a reason why you're not using ZPL? Your printer supports it.
Dec 15, 2014 at 8: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.GraphicDelete('R', "RLFSAM"));
      list1.AddRange(ZPLCommands.GraphicStore(new Bitmap(ImgPath), 'R', "RLFSAM"));
      new SpoolPrinter(settings).Print(list1.ToArray());


      List<byte> list2 = new List<byte>();
      list2.AddRange(ZPLCommands.GraphicWrite(1, 1, "RLFSAM", 'R'));
      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?