Description Use this command to load binary graphic data directly into the Image Buffer memory for immediate printing. The printer does not store graphic data sent directly to the image buffer.
The graphic data is lost when the image has finished printing, power is removed or the printer is reset. Commands that size (Q and q) or clear (N and M) the image buffer will also remove graphic image data.
p1 Horizontal start position (X) in dots.
p2 Vertical start position (Y) in dots.
p3 Width of graphic in bytes. Eight (8) dots = one (1) byte of data.
p4 Length of graphic in dots (or print lines)
DATA Raw binary data without graphic file formatting. Data must be in bytes. Multiply the width in bytes (p3) by the number of print lines (p4) for the total amount of graphic data. The printer automatically calculates the exact size of the data block based upon this formula.
The challenge here was to figure out what they exactly mean by Raw binary data without graphic file formatting!
So after some googling a colleague of mine found the following working solution on CodeProject and adapted it to our needs.
After analyzing the performance of our code under high load, we came to the conclusion that this extraction was actually really slowing the entire process down. It took around 1.5 seconds on average for a 10KB image (caused by usage of GetPixel).
What does it do?
Extracts raw binary data
Transforms the image into black and white
Adds a white overlay over parts that actually are out of bounds
What we needed?
Extract the raw binary data
As we already had an image within bounds which was already black and white (greyscale) in format1bppindexed format.